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

Public Member Functions

def __init__ (self, creator, maxusage=None, setsession=None, failures=None, ping=1, closeable=True, *args, **kwargs)
 
def __enter__ (self)
 
def __exit__ (self, *exc)
 
def dbapi (self)
 
def threadsafety (self)
 
def close (self)
 
def begin (self, *args, **kwargs)
 
def commit (self)
 
def rollback (self)
 
def cancel (self)
 
def ping (self, *args, **kwargs)
 
def cursor (self, *args, **kwargs)
 
def __del__ (self)
 

Static Public Attributes

 version = __version__
 

Private Member Functions

def _create (self)
 
def _setsession (self, con=None)
 
def _store (self, con)
 
def _close (self)
 
def _reset (self, force=False)
 
def _ping_check (self, ping=1, reconnect=True)
 
def _cursor (self, *args, **kwargs)
 

Private Attributes

 _con
 
 _closed
 
 _creator
 
 _dbapi
 
 _threadsafety
 
 _maxusage
 
 _setsession_sql
 
 _failures
 
 _ping
 
 _closeable
 
 _kwargs
 
 _failure
 
 _transaction
 
 _usage
 

Detailed Description

A "tough" version of DB-API 2 connections.

Definition at line 46 of file steady_db.py.

Constructor & Destructor Documentation

◆ __init__()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.__init__ (   self,
  creator,
  maxusage = None,
  setsession = None,
  failures = None,
  ping = 1,
  closeable = True,
args,
**  kwargs 
)
Create a "tough" DB-API 2 connection.

Definition at line 51 of file steady_db.py.

◆ __del__()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.__del__ (   self)
Delete the steady connection.

Definition at line 417 of file steady_db.py.

Here is the call graph for this function:

Member Function Documentation

◆ __enter__()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.__enter__ (   self)
Enter the runtime context for the connection object.

Definition at line 98 of file steady_db.py.

◆ __exit__()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.__exit__ (   self,
exc 
)
Exit the runtime context for the connection object.

This does not close the connection, but it ends a transaction.

Definition at line 102 of file steady_db.py.

Here is the call graph for this function:

◆ _close()

def aestate.opera.DBPool.steady_db.SteadyDBConnection._close (   self)
private
Close the tough connection.

You can always close a tough connection with this method
and it will not complain if you close it more than once.

Definition at line 218 of file steady_db.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _create()

def aestate.opera.DBPool.steady_db.SteadyDBConnection._create (   self)
private
Create a new connection using the creator function.

Definition at line 112 of file steady_db.py.

Here is the caller graph for this function:

◆ _cursor()

def aestate.opera.DBPool.steady_db.SteadyDBConnection._cursor (   self,
args,
**  kwargs 
)
private
A "tough" version of the method cursor().

Definition at line 375 of file steady_db.py.

Here is the call graph for this function:

◆ _ping_check()

def aestate.opera.DBPool.steady_db.SteadyDBConnection._ping_check (   self,
  ping = 1,
  reconnect = True 
)
private
Check whether the connection is still alive using ping().

If the the underlying connection is not active and the ping
parameter is set accordingly, the connection will be recreated
unless the connection is currently inside a transaction.

Definition at line 243 of file steady_db.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _reset()

def aestate.opera.DBPool.steady_db.SteadyDBConnection._reset (   self,
  force = False 
)
private
Reset a tough connection.

Rollback if forced or the connection was in a transaction.

Definition at line 232 of file steady_db.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setsession()

def aestate.opera.DBPool.steady_db.SteadyDBConnection._setsession (   self,
  con = None 
)
private
Execute the SQL commands for session preparation.

Definition at line 201 of file steady_db.py.

Here is the caller graph for this function:

◆ _store()

def aestate.opera.DBPool.steady_db.SteadyDBConnection._store (   self,
  con 
)
private
Store a database connection for subsequent use.

Definition at line 211 of file steady_db.py.

Here is the caller graph for this function:

◆ begin()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.begin (   self,
args,
**  kwargs 
)
Indicate the beginning of a transaction.

During a transaction, connections won't be transparently
replaced, and all errors will be raised to the application.

If the underlying driver supports this method, it will be called
with the given parameters (e.g. for distributed transactions).

Definition at line 311 of file steady_db.py.

Here is the caller graph for this function:

◆ cancel()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.cancel (   self)
Cancel a long-running transaction.

If the underlying driver supports this method, it will be called.

Definition at line 358 of file steady_db.py.

◆ close()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.close (   self)
Close the tough connection.

You are allowed to close a tough connection by default
and it will not complain if you close it more than once.

You can disallow closing connections by setting
the closeable parameter to something false.  In this case,
closing tough connections will be silently ignored.

Definition at line 296 of file steady_db.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ commit()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.commit (   self)
Commit any pending transaction.

Definition at line 328 of file steady_db.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cursor()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.cursor (   self,
args,
**  kwargs 
)
Return a new Cursor Object using the connection.

Definition at line 413 of file steady_db.py.

Here is the caller graph for this function:

◆ dbapi()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.dbapi (   self)
Return the underlying DB-API 2 module of the connection.

Definition at line 278 of file steady_db.py.

◆ ping()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.ping (   self,
args,
**  kwargs 
)
Ping connection.

Definition at line 371 of file steady_db.py.

Here is the caller graph for this function:

◆ rollback()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.rollback (   self)
Rollback pending transaction.

Definition at line 343 of file steady_db.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ threadsafety()

def aestate.opera.DBPool.steady_db.SteadyDBConnection.threadsafety (   self)
Return the thread safety level of the connection.

Definition at line 286 of file steady_db.py.

Member Data Documentation

◆ _closeable

aestate.opera.DBPool.steady_db.SteadyDBConnection._closeable
private

Definition at line 92 of file steady_db.py.

◆ _closed

aestate.opera.DBPool.steady_db.SteadyDBConnection._closed
private

Definition at line 55 of file steady_db.py.

◆ _con

aestate.opera.DBPool.steady_db.SteadyDBConnection._con
private

Definition at line 54 of file steady_db.py.

◆ _creator

aestate.opera.DBPool.steady_db.SteadyDBConnection._creator
private

Definition at line 58 of file steady_db.py.

◆ _dbapi

aestate.opera.DBPool.steady_db.SteadyDBConnection._dbapi
private

Definition at line 59 of file steady_db.py.

◆ _failure

aestate.opera.DBPool.steady_db.SteadyDBConnection._failure
private

Definition at line 187 of file steady_db.py.

◆ _failures

aestate.opera.DBPool.steady_db.SteadyDBConnection._failures
private

Definition at line 90 of file steady_db.py.

◆ _kwargs

aestate.opera.DBPool.steady_db.SteadyDBConnection._kwargs
private

Definition at line 93 of file steady_db.py.

◆ _maxusage

aestate.opera.DBPool.steady_db.SteadyDBConnection._maxusage
private

Definition at line 85 of file steady_db.py.

◆ _ping

aestate.opera.DBPool.steady_db.SteadyDBConnection._ping
private

Definition at line 91 of file steady_db.py.

◆ _setsession_sql

aestate.opera.DBPool.steady_db.SteadyDBConnection._setsession_sql
private

Definition at line 86 of file steady_db.py.

◆ _threadsafety

aestate.opera.DBPool.steady_db.SteadyDBConnection._threadsafety
private

Definition at line 73 of file steady_db.py.

◆ _transaction

aestate.opera.DBPool.steady_db.SteadyDBConnection._transaction
private

Definition at line 214 of file steady_db.py.

◆ _usage

aestate.opera.DBPool.steady_db.SteadyDBConnection._usage
private

Definition at line 216 of file steady_db.py.

◆ version

aestate.opera.DBPool.steady_db.SteadyDBConnection.version = __version__
static

Definition at line 49 of file steady_db.py.


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