Pool


Methods

f __init__(self, factory, dbapi_module, maxusage=None, blocking=False) ...

Create a connection pool.

factory:

a function that produces ready connections

dbapi_module:

the DB-API compliant module that connections come from

blocking:

determines behavior when exceeding the maximum (false means report an error; otherwise block and wait until the number of connections decreases)

maxusage:

maximum number of reuses of a single connection (None means unlimited reuse) When this maximum usage number of the connection is reached, the connection is automatically reset (closed and reopened).

f connection(self) ...

Get a solid, cached connection for the current thread

f solid_connection(self) ...

Get a solid, unpooled solid DB-API 2 connection.

f close(self) ...

Close all connections in the pool.

@@: This can't close connections in other threads, but should be able to.

f __del__(self) ...

Pool is being garbage collected

See the source for more information.