closing database connections

Frank Bechmann fBechmann at web.de
Sat Jan 24 14:04:39 EST 2004


there are two extra features to be taken into account when working
with database-connections (assuming you are working on problems that
require non-sequential DB-access):

as already mentioned DB-connections are valuable resources, they are
not only limited, their creation also is performance-relevant. so
quite soon you will find yourself working w/ connection pooling.

even more complicated are transactional problems because connections
"wrap" transactions; so there might be times when you must make sure
that consequent calls to the DB use the same transaction whereas in
other cases you need to access the DB with parallel but isolated
transactions.

So in conclusion I don't think that there is just one golden rule for
DB-connection creation and release, your golden rule will most of the
time be golden just for your actual problem.



More information about the Python-list mailing list