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

Public Member Functions

def __init__ (self, creator, maxusage=None, setsession=None, failures=None, ping=1, closeable=False, threadlocal=None, *args, **kwargs)
 
def steady_connection (self)
 
def connection (self, shareable=False)
 
def dedicated_connection (self)
 

Public Attributes

 thread
 

Static Public Attributes

 version = __version__
 

Private Attributes

 _creator
 
 _maxusage
 
 _setsession
 
 _failures
 
 _ping
 
 _closeable
 
 _kwargs
 

Detailed Description

生成基于db-api2的数据库连接池对象

Definition at line 20 of file persistent_db.py.

Constructor & Destructor Documentation

◆ __init__()

def aestate.opera.DBPool.persistent_db.PersistentDB.__init__ (   self,
  creator,
  maxusage = None,
  setsession = None,
  failures = None,
  ping = 1,
  closeable = False,
  threadlocal = None,
args,
**  kwargs 
)
设置持久性DB-API 2连接生成器。

创建者:返回新的DB-API 2的任意函数
    连接对象或符合DB-API 2的数据库模块
maxusage:连接池最大数量,0表示无限
setsession:可用于准备的SQL命令的可选列表
    会话,例如[“将日期样式设置为...”,“将时区设置为...”]
失败:可选的异常类或异常类的元组
    为此,应应用连接故障转移机制,
    如果默认值(OperationalError,InternalError)不足够
ping:确定何时应使用ping()检查连接
    (0 =无=永不,1 =默认=每当被请求时,
    2 =创建游标时,4 =执行查询时,
    7 =始终,以及这些值的所有其他位组合)
closeable:设置为True将允许被关闭
threadlocal:线程独立

Definition at line 26 of file persistent_db.py.

Member Function Documentation

◆ connection()

def aestate.opera.DBPool.persistent_db.PersistentDB.connection (   self,
  shareable = False 
)
共享连接
长时间未关闭则不会被共享

Definition at line 76 of file persistent_db.py.

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

◆ dedicated_connection()

def aestate.opera.DBPool.persistent_db.PersistentDB.dedicated_connection (   self)
Alias for connection(shareable=False).

Definition at line 90 of file persistent_db.py.

Here is the call graph for this function:

◆ steady_connection()

def aestate.opera.DBPool.persistent_db.PersistentDB.steady_connection (   self)
Get a steady, non-persistent DB-API 2 connection.

Definition at line 69 of file persistent_db.py.

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

Member Data Documentation

◆ _closeable

aestate.opera.DBPool.persistent_db.PersistentDB._closeable
private

Definition at line 62 of file persistent_db.py.

◆ _creator

aestate.opera.DBPool.persistent_db.PersistentDB._creator
private

Definition at line 57 of file persistent_db.py.

◆ _failures

aestate.opera.DBPool.persistent_db.PersistentDB._failures
private

Definition at line 60 of file persistent_db.py.

◆ _kwargs

aestate.opera.DBPool.persistent_db.PersistentDB._kwargs
private

Definition at line 63 of file persistent_db.py.

◆ _maxusage

aestate.opera.DBPool.persistent_db.PersistentDB._maxusage
private

Definition at line 58 of file persistent_db.py.

◆ _ping

aestate.opera.DBPool.persistent_db.PersistentDB._ping
private

Definition at line 61 of file persistent_db.py.

◆ _setsession

aestate.opera.DBPool.persistent_db.PersistentDB._setsession
private

Definition at line 59 of file persistent_db.py.

◆ thread

aestate.opera.DBPool.persistent_db.PersistentDB.thread

Definition at line 64 of file persistent_db.py.

◆ version

aestate.opera.DBPool.persistent_db.PersistentDB.version = __version__
static

Definition at line 24 of file persistent_db.py.


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