|
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) |
|
A "tough" version of DB-API 2 connections.
Definition at line 46 of file steady_db.py.
◆ __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 | ) |
|
◆ __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.
◆ _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.
◆ _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.
◆ _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.
◆ _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.
◆ _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.
◆ _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.
◆ _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.
◆ 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.
◆ 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.
◆ commit()
def aestate.opera.DBPool.steady_db.SteadyDBConnection.commit |
( |
|
self | ) |
|
Commit any pending transaction.
Definition at line 328 of file steady_db.py.
◆ 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.
◆ 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 |
|
) |
| |
◆ rollback()
def aestate.opera.DBPool.steady_db.SteadyDBConnection.rollback |
( |
|
self | ) |
|
◆ 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.
◆ _closeable
aestate.opera.DBPool.steady_db.SteadyDBConnection._closeable |
|
private |
◆ _closed
aestate.opera.DBPool.steady_db.SteadyDBConnection._closed |
|
private |
◆ _con
aestate.opera.DBPool.steady_db.SteadyDBConnection._con |
|
private |
◆ _creator
aestate.opera.DBPool.steady_db.SteadyDBConnection._creator |
|
private |
◆ _dbapi
aestate.opera.DBPool.steady_db.SteadyDBConnection._dbapi |
|
private |
◆ _failure
aestate.opera.DBPool.steady_db.SteadyDBConnection._failure |
|
private |
◆ _failures
aestate.opera.DBPool.steady_db.SteadyDBConnection._failures |
|
private |
◆ _kwargs
aestate.opera.DBPool.steady_db.SteadyDBConnection._kwargs |
|
private |
◆ _maxusage
aestate.opera.DBPool.steady_db.SteadyDBConnection._maxusage |
|
private |
◆ _ping
aestate.opera.DBPool.steady_db.SteadyDBConnection._ping |
|
private |
◆ _setsession_sql
aestate.opera.DBPool.steady_db.SteadyDBConnection._setsession_sql |
|
private |
◆ _threadsafety
aestate.opera.DBPool.steady_db.SteadyDBConnection._threadsafety |
|
private |
◆ _transaction
aestate.opera.DBPool.steady_db.SteadyDBConnection._transaction |
|
private |
◆ _usage
aestate.opera.DBPool.steady_db.SteadyDBConnection._usage |
|
private |
◆ version
aestate.opera.DBPool.steady_db.SteadyDBConnection.version = __version__ |
|
static |
The documentation for this class was generated from the following file: