closing database connections

Ken kenfar42 at
Sat Jan 24 06:03:01 CET 2004

dlee at (dustin lee) wrote in message news:<71fd0ae5.0401230838.309e9b02 at>...
>  I'd be interested to hear if any one has been bitten by not
> explicitly closing database connections and under what cirumstances. 
> My main fear is that I will "run out of" database connections or in
> some other way adversely affect server performance.  I'm using recent
> versions of both mysql and oracle.

Yep, you should definitely and explicitely close database connections.
 Failure to do so can easily leave connections open and resources
locked - not much unlike closing your ssh sessions by killing the
client rather that logging out.

Kind of a coincidence my seeing this email actually - just two minutes
ago I read an email from a team member instructing others on the team
to close their database connections (php/db2) because some connections
occasionally hang and interfere with our loads.


More information about the Python-list mailing list