Aestate
|
Public Member Functions | |
def | __init__ (self, mincached=0, maxcached=0, maxconnections=0, blocking=False, maxusage=None, setsession=None, reset=None, *args, **kwargs) |
def | steady_connection (self) |
def | connection (self) |
def | cache (self, con) |
def | close (self) |
def | __del__ (self) |
Static Public Attributes | |
version = __version__ | |
Private Attributes | |
_kwargs | |
_maxusage | |
_setsession | |
_reset | |
_connections | |
_blocking | |
_cache | |
Pool for classic PyGreSQL connections. After you have created the connection pool, you can use connection() to get pooled, steady PostgreSQL connections.
Definition at line 22 of file pooled_pg.py.
def aestate.opera.DBPool.pooled_pg.PooledPg.__init__ | ( | self, | |
mincached = 0 , |
|||
maxcached = 0 , |
|||
maxconnections = 0 , |
|||
blocking = False , |
|||
maxusage = None , |
|||
setsession = None , |
|||
reset = None , |
|||
* | args, | ||
** | kwargs | ||
) |
Set up the PostgreSQL connection pool. mincached: initial number of connections in the pool (0 means no connections are made at startup) maxcached: maximum number of connections in the pool (0 or None means unlimited pool size) maxconnections: maximum number of connections generally allowed (0 or None means an arbitrary number of connections) blocking: determines behavior when exceeding the maximum (if this is set to true, block and wait until the number of connections decreases, otherwise an error will be reported) maxusage: maximum number of reuses of a single connection (0 or None means unlimited reuse) When this maximum usage number of the connection is reached, the connection is automatically reset (closed and reopened). setsession: optional list of SQL commands that may serve to prepare the session, e.g. ["set datestyle to ...", "set time zone ..."] reset: how connections should be reset when returned to the pool (0 or None to rollback transcations started with begin(), 1 to always issue a rollback, 2 for a complete reset) args, kwargs: the parameters that shall be used to establish the PostgreSQL connections using class PyGreSQL pg.DB()
Definition at line 31 of file pooled_pg.py.
def aestate.opera.DBPool.pooled_pg.PooledPg.__del__ | ( | self | ) |
Delete the pool.
Definition at line 134 of file pooled_pg.py.
def aestate.opera.DBPool.pooled_pg.PooledPg.cache | ( | self, | |
con | |||
) |
Put a connection back into the pool cache.
Definition at line 103 of file pooled_pg.py.
def aestate.opera.DBPool.pooled_pg.PooledPg.close | ( | self | ) |
Close all connections in the pool.
Definition at line 120 of file pooled_pg.py.
def aestate.opera.DBPool.pooled_pg.PooledPg.connection | ( | self | ) |
Get a steady, cached PostgreSQL connection from the pool.
Definition at line 92 of file pooled_pg.py.
def aestate.opera.DBPool.pooled_pg.PooledPg.steady_connection | ( | self | ) |
Get a steady, unpooled PostgreSQL connection.
Definition at line 87 of file pooled_pg.py.
|
private |
Definition at line 74 of file pooled_pg.py.
|
private |
Definition at line 77 of file pooled_pg.py.
|
private |
Definition at line 73 of file pooled_pg.py.
|
private |
Definition at line 55 of file pooled_pg.py.
|
private |
Definition at line 56 of file pooled_pg.py.
|
private |
Definition at line 58 of file pooled_pg.py.
|
private |
Definition at line 57 of file pooled_pg.py.
|
static |
Definition at line 29 of file pooled_pg.py.