Package psycopg2 :: Module pool :: Class ThreadedConnectionPool
[show private | hide private]
[frames | no frames]

Type ThreadedConnectionPool

            object --+    
                     |    
AbstractConnectionPool --+
                         |
                        ThreadedConnectionPool


A connection pool that works with the threading module.


Method Summary
  __init__(self, minconn, maxconn, *args, **kwargs)
Initialize the threading lock.
  closeall(self)
Close all connections (even the one currently in use.)
  getconn(self, key)
Get a free connection and assign it to 'key' if not None.
  putconn(self, conn, key, close)
Put away an unused connection.
    Inherited from AbstractConnectionPool
  _closeall(self)
Close all connections.
  _connect(self, key)
Create a new connection and assign it to 'key' if not None.
  _getconn(self, key)
Get a free connection and assign it to 'key' if not None.
  _getkey(self)
Return a new unique key.
  _putconn(self, conn, key, close)
Put away a connection.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
Return repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Method Details

__init__(self, minconn, maxconn, *args, **kwargs)
(Constructor)

Initialize the threading lock.

Overrides:
psycopg2.pool.AbstractConnectionPool.__init__

closeall(self)

Close all connections (even the one currently in use.)

getconn(self, key=None)

Get a free connection and assign it to 'key' if not None.

putconn(self, conn=None, key=None, close=False)

Put away an unused connection.