I use a distributed database for which I installed IPVS to load balance, so I dbever connect to a virtual ip ... in LVS-DR is defined a time-out after which the virtual ip, if he sees no communication between client and server, stop the socket ... so I have to run "reconnect" in dbever ... you could open a connection for each sql script execution?
Grazie, Massimo