Database connection caching

Simon Brunning simon.brunning at
Fri Mar 18 17:45:38 CET 2005

On 18 Mar 2005 04:52:03 -0800, lbolognini at
<lbolognini at> wrote:
> is there an alternative way of:
> - create a connection object
> - open the connection
> - close the connection
> every time one has to run a query.

It's actually morte like:

create connection
create cursor
execute SQL
process cursor
close cursor
close connection

The bit that you can avoid it the creation of the connection - that's
an intensive process. If your system is single threaded, or if it's a
very small app, you can just create a single open connection and keep
using that. I usually find that I need a pool of open connections,

Simon B,
simon at,

More information about the Python-list mailing list