Aestate
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

 _kwargs
 
 _maxusage
 
 _setsession
 
 _reset
 
 _connections
 
 _blocking
 
 _cache
 

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 pooled_pg.py.

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,
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.

◆ __del__()

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

Definition at line 134 of file pooled_pg.py.

Here is the call graph for this function:

Member Function Documentation

◆ cache()

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.

◆ close()

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

Definition at line 120 of file pooled_pg.py.

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 pooled_pg.py.

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 pooled_pg.py.

Here is the caller graph for this function:

Member Data Documentation

◆ _blocking

aestate.opera.DBPool.pooled_pg.PooledPg._blocking
private

Definition at line 74 of file pooled_pg.py.

◆ _cache

aestate.opera.DBPool.pooled_pg.PooledPg._cache
private

Definition at line 77 of file pooled_pg.py.

◆ _connections

aestate.opera.DBPool.pooled_pg.PooledPg._connections
private

Definition at line 73 of file pooled_pg.py.

◆ _kwargs

aestate.opera.DBPool.pooled_pg.PooledPg._kwargs
private

Definition at line 55 of file pooled_pg.py.

◆ _maxusage

aestate.opera.DBPool.pooled_pg.PooledPg._maxusage
private

Definition at line 56 of file pooled_pg.py.

◆ _reset

aestate.opera.DBPool.pooled_pg.PooledPg._reset
private

Definition at line 58 of file pooled_pg.py.

◆ _setsession

aestate.opera.DBPool.pooled_pg.PooledPg._setsession
private

Definition at line 57 of file pooled_pg.py.

◆ version

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

Definition at line 29 of file pooled_pg.py.


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