|
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) |
|
生成基于db-api2的数据库连接池对象
Definition at line 20 of file persistent_db.py.
◆ __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.
◆ connection()
def aestate.opera.DBPool.persistent_db.PersistentDB.connection |
( |
|
self, |
|
|
|
shareable = False |
|
) |
| |
◆ dedicated_connection()
def aestate.opera.DBPool.persistent_db.PersistentDB.dedicated_connection |
( |
|
self | ) |
|
◆ 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.
◆ _closeable
aestate.opera.DBPool.persistent_db.PersistentDB._closeable |
|
private |
◆ _creator
aestate.opera.DBPool.persistent_db.PersistentDB._creator |
|
private |
◆ _failures
aestate.opera.DBPool.persistent_db.PersistentDB._failures |
|
private |
◆ _kwargs
aestate.opera.DBPool.persistent_db.PersistentDB._kwargs |
|
private |
◆ _maxusage
aestate.opera.DBPool.persistent_db.PersistentDB._maxusage |
|
private |
◆ _ping
aestate.opera.DBPool.persistent_db.PersistentDB._ping |
|
private |
◆ _setsession
aestate.opera.DBPool.persistent_db.PersistentDB._setsession |
|
private |
◆ thread
aestate.opera.DBPool.persistent_db.PersistentDB.thread |
◆ version
aestate.opera.DBPool.persistent_db.PersistentDB.version = __version__ |
|
static |
The documentation for this class was generated from the following file: