Skip to content

Commit 9fcce6e

Browse files
Doc updates.
1 parent 382e64d commit 9fcce6e

File tree

5 files changed

+86
-66
lines changed

5 files changed

+86
-66
lines changed

doc/src/api_manual/async_connection_pool.rst

+14-12
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ AsyncConnectionPool Attributes
119119

120120
.. attribute:: AsyncConnectionPool.max_lifetime_session
121121

122-
This read-write attribute returns the maximum length of time (in seconds)
123-
that a pooled connection may exist. Connections that are in use will not be
124-
closed. They become candidates for termination only when they are released
125-
back to the pool and have existed for longer than max_lifetime_session
126-
seconds. Note that termination only occurs when the pool is accessed. A
127-
value of *0* means that there is no maximum length of time that a pooled
128-
connection may exist. This attribute is only available in Oracle Database
129-
12.1 or later.
122+
This read-write attribute is the maximum length of time (in seconds) that a
123+
pooled connection may exist since first being created. A value of *0* means
124+
there is no limit. Connections become candidates for termination when they
125+
are acquired or released back to the pool, and have existed for longer than
126+
``max_lifetime_session`` seconds. Connections that are in active use will
127+
not be closed. In python-oracledb Thick mode, Oracle Client libraries 12.1
128+
or later must be used and, prior to Oracle Client 21, cleanup only occurs
129+
when the pool is accessed.
130130

131131
.. attribute:: AsyncConnectionPool.max_sessions_per_shard
132132

@@ -189,10 +189,12 @@ AsyncConnectionPool Attributes
189189

190190
.. attribute:: AsyncConnectionPool.timeout
191191

192-
This read-write attribute specifies the time (in seconds) after which idle
193-
connections will be terminated in order to maintain an optimum number of
194-
open connections. A value of *0* means that no idle connections are
195-
terminated.
192+
This read-only attribute is an integer that specifies the length of time
193+
(in seconds) that a connection may remain idle in the pool before it is
194+
terminated. This applies only when the pool has more than ``min``
195+
connections open, allowing it to shrink to the specified minimum size. The
196+
default value is *0* seconds. A value of *0* means that there is no maximum
197+
time.
196198

197199
.. attribute:: AsyncConnectionPool.username
198200

doc/src/api_manual/connection_pool.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ ConnectionPool Attributes
216216

217217
.. attribute:: ConnectionPool.max_lifetime_session
218218

219-
This read-write attribute returns the maximum length of time (in seconds)
220-
that a pooled connection may exist. Connections that are in use will not be
221-
closed. They become candidates for termination only when they are released
222-
back to the pool and have existed for longer than max_lifetime_session
223-
seconds. Note that termination only occurs when the pool is accessed. A
224-
value of *0* means that there is no maximum length of time that a pooled
225-
connection may exist. This attribute is only available in Oracle Database
226-
12.1 or later.
219+
This read-write attribute is the maximum length of time (in seconds) that a
220+
pooled connection may exist since first being created. A value of *0* means
221+
there is no limit. Connections become candidates for termination when they
222+
are acquired or released back to the pool, and have existed for longer than
223+
``max_lifetime_session`` seconds. Connections that are in active use will
224+
not be closed. In python-oracledb Thick mode, Oracle Client libraries 12.1
225+
or later must be used and, prior to Oracle Client 21, cleanup only occurs
226+
when the pool is accessed.
227227

228228
.. attribute:: ConnectionPool.max_sessions_per_shard
229229

doc/src/api_manual/module.rst

+30-21
Original file line numberDiff line numberDiff line change
@@ -1229,21 +1229,24 @@ Oracledb Methods
12291229
users). The default value is *True*.
12301230

12311231
The ``timeout`` parameter is the length of time (in seconds) that a
1232-
connection may remain idle in the pool before it is terminated. This
1232+
connection may remain idle in the pool before it is terminated. This
12331233
applies only when the pool has more than ``min`` connections open, allowing
1234-
it to shrink to the specified minimum size. If the value of this parameter
1235-
is 0, then the connections are never terminated. The default value is *0*
1236-
seconds.
1234+
it to shrink to the specified minimum size. The default value is *0*
1235+
seconds. A value of *0* means there is no limit.
12371236

12381237
The ``wait_timeout`` parameter is the length of time (in milliseconds) that
12391238
a caller should wait when acquiring a connection from the pool with
12401239
``getmode`` set to :data:`oracledb.POOL_GETMODE_TIMEDWAIT`. The default
12411240
value is *0* milliseconds.
12421241

12431242
The ``max_lifetime_session`` parameter is the length of time (in seconds)
1244-
that connections can remain in the pool. If the value of this parameter is
1245-
0, then the connections may remain in the pool indefinitely. The default
1246-
value is *0* seconds.
1243+
that a pooled connection may exist since first being created. The default
1244+
value is *0*. A value of *0* means that there is no limit. Connections
1245+
become candidates for termination when they are acquired or released back
1246+
to the pool and have existed for longer than ``max_lifetime_session``
1247+
seconds. In python-oracledb Thick mode, Oracle Client libraries 12.1 or
1248+
later must be used and, prior to Oracle Client 21, cleanup only occurs when
1249+
the pool is accessed.
12471250

12481251
The ``session_callback`` parameter is a callable that is invoked when a
12491252
connection is returned from the pool for the first time, or when the
@@ -1687,21 +1690,24 @@ Oracledb Methods
16871690
users). The default value is *True*.
16881691

16891692
The ``timeout`` parameter is the length of time (in seconds) that a
1690-
connection may remain idle in the pool before it is terminated. This
1693+
connection may remain idle in the pool before it is terminated. This
16911694
applies only when the pool has more than ``min`` connections open, allowing
1692-
it to shrink to the specified minimum size. If the value of this parameter
1693-
is 0, then the connections are never terminated. The default value is *0*
1694-
seconds.
1695+
it to shrink to the specified minimum size. The default value is *0*
1696+
seconds. A value of *0* means there is no limit.
16951697

16961698
The ``wait_timeout`` parameter is the length of time (in milliseconds) that
16971699
a caller should wait when acquiring a connection from the pool with
16981700
``getmode`` set to :data:`oracledb.POOL_GETMODE_TIMEDWAIT`. The default
16991701
value is *0* milliseconds.
17001702

17011703
The ``max_lifetime_session`` parameter is the length of time (in seconds)
1702-
that connections can remain in the pool. If the value of this parameter is
1703-
0, then the connections may remain in the pool indefinitely. The default
1704-
value is *0* seconds.
1704+
that a pooled connection may exist since first being created. The default
1705+
value is *0*. A value of *0* means that there is no limit. Connections
1706+
become candidates for termination when they are acquired or released back
1707+
to the pool and have existed for longer than ``max_lifetime_session``
1708+
seconds. In python-oracledb Thick mode, Oracle Client libraries 12.1 or
1709+
later must be used and, prior to Oracle Client 21, cleanup only occurs when
1710+
the pool is accessed.
17051711

17061712
The ``session_callback`` parameter is a callable that is invoked when a
17071713
connection is returned from the pool for the first time, or when the
@@ -2202,21 +2208,24 @@ Oracledb Methods
22022208
The default value is *True*.
22032209

22042210
The ``timeout`` parameter is the length of time (in seconds) that a
2205-
connection may remain idle in the pool before it is terminated. This
2211+
connection may remain idle in the pool before it is terminated. This
22062212
applies only when the pool has more than ``min`` connections open, allowing
2207-
it to shrink to the specified minimim size. If the value of this parameter
2208-
is 0, then the connections are never terminated. The default value is *0*
2209-
seconds.
2213+
it to shrink to the specified minimum size. The default value is *0*
2214+
seconds. A value of *0* means there is no limit.
22102215

22112216
The ``wait_timeout`` parameter is the length of time (in milliseconds) that
22122217
a caller should wait when acquiring a connection from the pool with
22132218
``getmode`` set to :data:`oracledb.POOL_GETMODE_TIMEDWAIT`. The default
22142219
value is *0* milliseconds.
22152220

22162221
The ``max_lifetime_session`` parameter is the length of time (in seconds)
2217-
that connections can remain in the pool. If the value of this parameter is
2218-
0, then the connections may remain in the pool indefinitely. The default
2219-
value is *0* seconds.
2222+
that a pooled connection may exist since first being created. The default
2223+
value is *0*. A value of *0* means that there is no limit. Connections
2224+
become candidates for termination when they are acquired or released back
2225+
to the pool and have existed for longer than ``max_lifetime_session``
2226+
seconds. In python-oracledb Thick mode, Oracle Client libraries 12.1 or
2227+
later must be used and, prior to Oracle Client 21, cleanup only occurs when
2228+
the pool is accessed.
22202229

22212230
The ``session_callback`` parameter is a callable that is invoked when a
22222231
connection is returned from the pool for the first time, or when the

doc/src/api_manual/pool_params.rst

+13-7
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,14 @@ PoolParams Attributes
131131

132132
.. attribute:: PoolParams.max_lifetime_session
133133

134-
This read-only attribute is an integer that determines the length of time
135-
(in seconds) that connections can remain in the pool. If the value of this
136-
attribute is *0*, then the connections may remain in the pool indefinitely.
137-
The default value is *0* seconds.
134+
This read-only attribute is the maximum length of time (in seconds) that a
135+
pooled connection may exist since first being created. A value of *0* means
136+
there is no limit. Connections become candidates for termination when they
137+
are acquired or released back to the pool, and have existed for longer than
138+
``max_lifetime_session`` seconds. Connections that are in active use will
139+
not be closed. In python-oracledb Thick mode, Oracle Client libraries 12.1
140+
or later must be used and, prior to Oracle Client 21, cleanup only occurs
141+
when the pool is accessed.
138142

139143
.. attribute:: PoolParams.max_sessions_per_shard
140144

@@ -189,10 +193,12 @@ PoolParams Attributes
189193

190194
This read-only attribute is an integer that specifies the length of time
191195
(in seconds) that a connection may remain idle in the pool before it is
192-
terminated. If the value of this attribute is *0*, then the connections
193-
are never terminated. The default value is *0* seconds.
196+
terminated. This applies only when the pool has more than ``min``
197+
connections open, allowing it to shrink to the specified minimum size. The
198+
default value is *0* seconds. A value of *0* means that there is no maximum
199+
time.
194200

195-
This attribute is only supported in python-oracledb Thick mode.
201+
This attribute is supported in both python-oracledb Thin and Thick modes.
196202

197203
.. attribute:: PoolParams.wait_timeout
198204

doc/src/user_guide/connection_handling.rst

+21-18
Original file line numberDiff line numberDiff line change
@@ -2069,26 +2069,29 @@ regardless of how big ``increment`` is. The pool will then continue to
20692069
re-establish connections in a background thread.
20702070

20712071
A connection pool can shrink back to its minimum size ``min`` when connections
2072-
opened by the pool are not used by the application. This frees up database
2073-
resources while allowing pools to retain connections for active users. If
2074-
connections are idle in the pool (i.e. not currently acquired by the
2075-
application) and are unused for longer than the pool creation attribute
2076-
``timeout`` value, then they will be closed. The check occurs every
2077-
``timeout`` interval and hence in the worst case it may take twice the
2078-
``timeout`` time to close the idle connections. The default ``timeout`` is 0
2079-
seconds signifying an infinite time and meaning idle connections will never be
2080-
closed.
2072+
opened by the pool are not used by the application. This frees up database
2073+
resources while allowing pools to retain open connections for active users. If
2074+
there are more than ``min`` connections open, and connections are idle in the
2075+
pool (i.e. not currently acquired by the application) and unused for longer
2076+
than the pool creation attribute ``timeout`` value, then they will be closed.
2077+
The check occurs every ``timeout`` interval and hence in the worst case it may
2078+
take twice the ``timeout`` time to close the idle connections. The default
2079+
``timeout`` is *0* seconds signifying an infinite time and meaning idle
2080+
connections will never be closed.
20812081

20822082
The pool creation parameter ``max_lifetime_session`` also allows pools to
2083-
shrink. This parameter bounds the total length of time that a connection can
2084-
exist starting from the time the pool created it. If a connection was created
2085-
``max_lifetime_session`` or longer seconds ago, then it will be closed when it
2086-
is idle in the pool. In the case when ``timeout`` and ``max_lifetime_session``
2087-
are both set, the connection will be terminated if either the idle timeout
2088-
happens or the max lifetime setting is exceeded. Note that when using
2089-
python-oracledb in Thick mode with Oracle Client libraries prior to 21c, pool
2090-
shrinkage is only initiated when the pool is accessed so pools in fully dormant
2091-
applications will not shrink until the application is next used.
2083+
shrink. This parameter bounds the total length of time that a connection can
2084+
exist starting from the time that it was created in the pool. It is mostly used
2085+
for defensive programming to mitigate against unforeseeable problems that may
2086+
occur with connections. If a connection was created ``max_lifetime_session`` or
2087+
longer seconds ago, then it will be a candidate for being closed. In the case
2088+
when ``timeout`` and ``max_lifetime_session`` are both set, the connection will
2089+
be terminated if either the idle timeout happens or the maximum lifetime
2090+
setting is exceeded. Note that when using python-oracledb in Thick mode with
2091+
Oracle Client libraries prior to 21c, pool shrinkage is only initiated when the
2092+
pool is accessed so pools in fully dormant applications will not shrink until
2093+
the application is next used. In Thick mode, Oracle Client libraries 12.1, or
2094+
later, are needed to use ``max_lifetime_session``.
20922095

20932096
For pools created with :ref:`external authentication <extauth>`, with
20942097
:ref:`homogeneous <connpooltypes>` set to False, or when using :ref:`drcp` (in

0 commit comments

Comments
 (0)