python-cx_Oracle/doc/session_pool.rst
Anthony Tuininga 168d61670e Removed password attribute from connection and session pool objects in order
to promote best security practices (if stored in RAM in cleartext it can be
read in process dumps, for example). For those who would like to retain this
feature, a subclass of Connection could be used to store the password.
2015-07-31 14:31:13 -06:00

97 lines
2.4 KiB
ReStructuredText

.. _sesspool:
******************
SessionPool Object
******************
.. note::
This object is an extension the DB API.
.. method:: SessionPool.acquire()
Acquire a connection from the session pool and return a connection object
(:ref:`connobj`).
.. attribute:: SessionPool.busy
This read-only attribute returns the number of sessions currently acquired.
.. method:: SessionPool.drop(connection)
Drop the connection from the pool which is useful if the connection is no
longer usable (such as when the session is killed).
.. attribute:: SessionPool.dsn
This read-only attribute returns the TNS entry of the database to which a
connection has been established.
.. attribute:: SessionPool.homogeneous
This read-write boolean attribute indicates whether the pool is considered
homogeneous or not. If the pool is not homogeneous different authentication
can be used for each connection acquired from the pool.
.. attribute:: SessionPool.increment
This read-only attribute returns the number of sessions that will be
established when additional sessions need to be created.
.. attribute:: SessionPool.max
This read-only attribute returns the maximum number of sessions that the
session pool can control.
.. attribute:: SessionPool.min
This read-only attribute returns the number of sessions with which the
session pool was created and the minimum number of sessions that will be
controlled by the session pool.
.. attribute:: SessionPool.name
This read-only attribute returns the name assigned to the session pool by
Oracle.
.. attribute:: SessionPool.opened
This read-only attribute returns the number of sessions currently opened by
the session pool.
.. method:: SessionPool.release(connection)
Release the connection back to the pool. This will be done automatically as
well if the connection object is garbage collected.
.. attribute:: SessionPool.timeout
This read-write attribute indicates the time (in seconds) after which idle
sessions will be terminated in order to maintain an optimum number of open
sessions.
.. attribute:: SessionPool.tnsentry
This read-only attribute returns the TNS entry of the database to which a
connection has been established.
.. attribute:: SessionPool.username
This read-only attribute returns the name of the user which established the
connection to the database.