Public Member Functions | Static Public Attributes | Private Attributes | List of all members
aestate.opera.DBPool.pooled_pg.PooledPg Class Reference
Collaboration diagram for aestate.opera.DBPool.pooled_pg.PooledPg:
Collaboration graph

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


Detailed Description

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

Constructor & Destructor Documentation

◆ __init__()

def aestate.opera.DBPool.pooled_pg.PooledPg.__init__ (   self,
  mincached = 0,
  maxcached = 0,
  maxconnections = 0,
  blocking = False,
  maxusage = None,
  setsession = None,
  reset = None,
**  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

◆ __del__()

def aestate.opera.DBPool.pooled_pg.PooledPg.__del__ (   self)
Delete the pool.

Definition at line 134 of file

Here is the call graph for this function:

Member Function Documentation

◆ cache()

def aestate.opera.DBPool.pooled_pg.PooledPg.cache (   self,
Put a connection back into the pool cache.

Definition at line 103 of file

◆ close()

def aestate.opera.DBPool.pooled_pg.PooledPg.close (   self)
Close all connections in the pool.

Definition at line 120 of file

Here is the caller graph for this function:

◆ connection()

def aestate.opera.DBPool.pooled_pg.PooledPg.connection (   self)
Get a steady, cached PostgreSQL connection from the pool.

Definition at line 92 of file

Here is the call graph for this function:

◆ steady_connection()

def aestate.opera.DBPool.pooled_pg.PooledPg.steady_connection (   self)
Get a steady, unpooled PostgreSQL connection.

Definition at line 87 of file

Here is the caller graph for this function:

Member Data Documentation

◆ _blocking


Definition at line 74 of file

◆ _cache


Definition at line 77 of file

◆ _connections


Definition at line 73 of file

◆ _kwargs


Definition at line 55 of file

◆ _maxusage


Definition at line 56 of file

◆ _reset


Definition at line 58 of file

◆ _setsession


Definition at line 57 of file

◆ version

aestate.opera.DBPool.pooled_pg.PooledPg.version = __version__

Definition at line 29 of file

The documentation for this class was generated from the following file: