I don't know the best practice here but what if we start the connection outside the function? I mean, have only one connection per server (not per request).