Yes, it is possible, although unlikely. If you're concerned about it, the simplest thing to do is to modify that code so that it will only reconnect at the beginning of a new web request. How you do that depends a bit on your environment. (For example, stashing the connection in $r->pnotes() makes sense for mod_perl.) It's not a good idea to just never reconnect, since periods of inactivity in a web application often lead to timeouts on the database connections.