class Pool(log.Identified):
Method | __init__ |
Construct a Pool. |
Method | connect |
Return a DBAPI connection from the pool. |
Method | dispose |
Dispose of this pool. |
Method | recreate |
Return a new _pool.Pool , of the same class as this one and configured with identical creation arguments. |
Method | _close_connection |
Undocumented |
Method | _create_connection |
Called by subclasses to create a new ConnectionRecord. |
Method | _creator.setter |
Undocumented |
Method | _do_get |
Implementation for get , supplied by subclasses. |
Method | _do_return_conn |
Implementation for return_conn , supplied by subclasses. |
Method | _invalidate |
Mark all connections established within the generation of the given connection as invalidated. |
Method | _return_conn |
Given a _ConnectionRecord, return it to the _pool.Pool . |
Method | _should_wrap_creator |
Detect if creator accepts a single argument, or is sent as a legacy style no-arg function. |
Method | status |
Undocumented |
Instance Variable | _dialect |
Undocumented |
Instance Variable | _invalidate_time |
Undocumented |
Instance Variable | _invoke_creator |
Undocumented |
Instance Variable | _orig_logging_name |
Undocumented |
Instance Variable | _pre_ping |
Undocumented |
Instance Variable | _recycle |
Undocumented |
Instance Variable | _reset_on_return |
Undocumented |
Instance Variable | echo |
Undocumented |
Instance Variable | logging_name |
Undocumented |
Property | _creator |
Undocumented |
Property | _is_asyncio |
Undocumented |
Inherited from Identified
:
Method | _should_log_debug |
Undocumented |
Method | _should_log_info |
Undocumented |
Parameters | |
creator | a callable function that returns a DB-API connection object. The function will be called with parameters. |
recycle | If set to a value other than -1, number of seconds between connection recycling, which means upon checkout, if this timeout is surpassed the connection will be closed and replaced with a newly opened connection. Defaults to -1. |
echo | if True, the connection pool will log informational output such as when connections are invalidated as well as when connections are recycled to the default log handler, which defaults to sys.stdout for output.. If set to the string "debug", the logging will include pool checkouts and checkins. The :paramref:`_pool.Pool.echo` parameter can also be set from the
See Also :ref:`dbengine_logging` - further detail on how to configure logging. |
logging_name | String identifier which will be used within the "name" field of logging records generated within the "sqlalchemy.pool" logger. Defaults to a hexstring of the object's id. |
reset_on_return |
See Also |
events | a list of 2-tuples, each of the form
(callable, target) which will be passed to .event.listen
upon construction. Provided here so that event listeners
can be assigned via _sa.create_engine before dialect-level
listeners are applied. |
dialect | a
New in version 1.1: - dialect is now a public parameter
to the
_pool.Pool . |
pre_ping | if True, the pool will emit a "ping" (typically "SELECT 1", but is dialect-specific) on the connection upon checkout, to test if the connection is alive or not. If not, the connection is transparently re-connected and upon success, all other pooled connections established prior to that timestamp are invalidated. Requires that a dialect is passed as well to interpret the disconnection error.
New in version 1.2.
|
_dispatch | Undocumented |
Return a DBAPI connection from the pool.
The connection is instrumented such that when its close() method is called, the connection will be returned to the pool.
Dispose of this pool.
This method leaves the possibility of checked-out connections remaining open, as it only affects connections that are idle in the pool.
See Also
Return a new _pool.Pool
, of the same class as this one
and configured with identical creation arguments.
This method is used in conjunction with dispose
to close out an entire _pool.Pool
and create a new one in
its place.
Mark all connections established within the generation of the given connection as invalidated.
If this pool's last invalidate time is before when the given connection was created, update the timestamp til now. Otherwise, no action is performed.
Connections with a start time prior to this pool's invalidation time will be recycled upon next checkout.
Given a _ConnectionRecord, return it to the _pool.Pool
.
This method is called when an instrumented DBAPI connection has its close() method called.