Package twisted :: Package enterprise :: Module adbapi :: Class ConnectionPool
[frames | no frames]

Class ConnectionPool

Jellyable --+        
            |        
 Serializable --+    
                |    
    Referenceable --+
                    |
                   ConnectionPool


I represent a pool of connections to a DB-API 2.0 compliant database.

You can pass cp_min, cp_max or both to set the minimum and maximum number of connections that will be opened by the pool. You can pass the noisy arg which determines whether informational log messages are generated during the pool's operation.
Method Summary
  __init__(self, dbapiName, *connargs, **connkw)
See ConnectionPool.__doc__
  __getstate__(self)
  __setstate__(self, state)
  _deferToThread(self, f, *args, **kwargs)
Internal function.
  _runInteraction(self, interaction, *args, **kw)
  _runOperation(self, *args, **kw)
  _runQuery(self, *args, **kw)
  close(self)
Close all pool connections and shutdown the pool.
  connect(self)
Return a database connection when one becomes available.
  finalClose(self)
This should only be called by the shutdown trigger.
  getStateFor(self, jellier)
  interaction(self, interaction, callback, errback, *args, **kw)
  jellyFor(self, jellier)
(internal)
  operation(self, callback, errback, *args, **kw)
  processUniqueID(self)
Return an ID which uniquely represents this object for this process.
  query(self, callback, errback, *args, **kw)
  remoteMessageReceived(self, broker, message, args, kw)
A remote message has been received.
  runInteraction(...)
  runOperation(...)
  runQuery(...)
  start(...)
  synchronousOperation(...)

Class Variable Summary
int max = 5                                                                     
int min = 3                                                                     
int noisy = 1                                                                     
int running = 0                                                                     

Method Details

__init__(self, dbapiName, *connargs, **connkw)
(Constructor)

See ConnectionPool.__doc__

_deferToThread(self, f, *args, **kwargs)

Internal function.

Call f in one of the connection pool's threads.

close(self)

Close all pool connections and shutdown the pool.

connect(self)

Return a database connection when one becomes available. This method blocks and should be run in a thread from the internal threadpool.

Don't call this method directly from non-threaded twisted code.
Returns:
a database connection from the pool.

finalClose(self)

This should only be called by the shutdown trigger.

Class Variable Details

max

Type:
int
Value:
5                                                                     

min

Type:
int
Value:
3                                                                     

noisy

Type:
int
Value:
1                                                                     

running

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.0 on Sat Oct 25 00:55:12 2003 http://epydoc.sf.net