Added support for setting the max lifetime session of pool connections, a

feature added to Oracle Database in 12.1.
This commit is contained in:
Anthony Tuininga 2016-01-26 14:32:59 -07:00
parent 84cd718977
commit 2da756e0cc
2 changed files with 18 additions and 0 deletions

View File

@ -29,6 +29,9 @@ static ub4 gc_OpenAttribute = OCI_ATTR_SPOOL_OPEN_COUNT;
static ub4 gc_BusyAttribute = OCI_ATTR_SPOOL_BUSY_COUNT;
static ub4 gc_TimeoutAttribute = OCI_ATTR_SPOOL_TIMEOUT;
static ub4 gc_GetModeAttribute = OCI_ATTR_SPOOL_GETMODE;
#if ORACLE_VERSION_HEX >= ORACLE_VERSION(12, 1)
static ub4 gc_MaxLifetimeAttribute = OCI_ATTR_SPOOL_MAX_LIFETIME_SESSION;
#endif
//-----------------------------------------------------------------------------
// functions for the Python type "SessionPool"
@ -82,6 +85,10 @@ static PyGetSetDef g_SessionPoolCalcMembers[] = {
(setter) SessionPool_SetOCIAttr, 0, &gc_TimeoutAttribute },
{ "getmode", (getter) SessionPool_GetOCIAttr,
(setter) SessionPool_SetOCIAttr, 0, &gc_GetModeAttribute },
#if ORACLE_VERSION_HEX >= ORACLE_VERSION(12, 1)
{ "max_lifetime_session", (getter) SessionPool_GetOCIAttr,
(setter) SessionPool_SetOCIAttr, 0, &gc_MaxLifetimeAttribute },
#endif
{ NULL }
};

View File

@ -51,6 +51,17 @@ SessionPool Object
session pool can control.
.. attribute:: SessionPool.max_lifetime_session
This read-write attribute returns the lifetime (in seconds) for all of the
sessions in the pool. Sessions in the pool are terminated when they have
reached their lifetime. If timeout is also set, the session will be
terminated if either the idle timeout happens or the max lifetime setting
is exceeded. This attribute is only available in Oracle Database 12.1.
.. versionadded:: development
.. attribute:: SessionPool.min
This read-only attribute returns the number of sessions with which the