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:
parent
84cd718977
commit
2da756e0cc
@ -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 }
|
||||
};
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user