Skip to content

Commit 5eb11b9

Browse files
committed
Documentation updates
1 parent 5027f69 commit 5eb11b9

File tree

3 files changed

+75
-3
lines changed

3 files changed

+75
-3
lines changed

doc/src/api_manual/oracledb.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,20 @@ Oracledb Methods
22652265
This optional property overrides the :attr:`oracledb.machine` property.
22662266

22672267
.. versionadded:: 6.7
2268+
* - ``maxLifetimeSession``
2269+
- Number
2270+
- Both
2271+
- .. _createpoolpoolattrsmaxlifetimesession:
2272+
2273+
The number of seconds that a pooled connection can exist in a pool after first being created. A value of *0* means there is no limit defined for the connection in a pool and no connections will be terminated. Connections become candidates for termination when they are acquired or released back to the pool, and have existed for longer than ``maxLifetimeSession`` seconds. Connections that are in active use will not be closed.
2274+
2275+
In node-oracledb Thick mode, Oracle Client libraries 12.1 or later must be used. Note that when using node-oracledb in Thick mode with Oracle Client libraries prior to 21c, pool shrinkage is only initiated when the pool is accessed. So, pools in fully dormant applications will not shrink until the application is next used.
2276+
2277+
The default value is *0*.
2278+
2279+
See :ref:`conpoolsizing`.
2280+
2281+
.. versionadded:: 6.9
22682282
* - ``networkCompression``
22692283
- Boolean
22702284
- Thin
@@ -2791,11 +2805,11 @@ Oracledb Methods
27912805
* - ``authType``
27922806
- The authentication type. The value should be the string *configFileBasedAuthentication*, *simpleAuthentication*, or *instancePrincipal*.
27932807

2794-
In Configuration File Based Authentication, the location of the configuration file containing the necessary information must be provided.
2808+
With Configuration File Based Authentication, the location of the configuration file containing the necessary information must be provided.
27952809

2796-
In Simple Authentication, the configuration parameters can be provided at runtime.
2810+
With Simple Authentication, the configuration parameters can be provided at runtime.
27972811

2798-
In Instance Principal Authentication, an instance can be authorized to make API calls on OCI services without credentials. The authentication method will only work on compute instances where internal network endpoints are reachable.
2812+
With Instance Principal Authentication, OCI compute instances can be authorized to access services on Oracle Cloud such as Oracle Autonomous Database. Node.js applications running on such a compute instance are automatically authenticated, eliminating the need to provide database user credentials. This authentication method will only work on compute instances where internal network endpoints are reachable. For more information on OCI compute instances, see `OCI Compute Instances <https://docs.oracle.com/en-us/iaas/compute-cloud-at-customer/topics/compute/compute-instances.htm>`__, `Creating a Compute Instance <https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/launchinginstance.htm>`__, and `Calling Services from a Compute Instance <https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm>`__.
27992813

28002814
See `OCI SDK Authentication Methods <https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm>`__ for more information.
28012815
- Required

doc/src/api_manual/pool.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,29 @@ values.
113113
See :ref:`homogeneous <createpoolpoolattrshomogeneous>` parameter of
114114
:meth:`oracledb.createPool()`.
115115

116+
.. attribute:: pool.maxLifetimeSession
117+
118+
This read-only property is the number of seconds that a pooled connection
119+
can exist in a pool after first being created.
120+
121+
A value of *0* means there is no limit defined for the connection in a
122+
pool and no connections will be terminated. Connections become candidates
123+
for termination when they are acquired or released back to the pool, and
124+
have existed for longer than ``maxLifetimeSession`` seconds. Connections
125+
that are in active use will not be closed.
126+
127+
In node-oracledb Thick mode, Oracle Client libraries 12.1 or later must
128+
be used. Note that when using node-oracledb in Thick mode with Oracle
129+
Client libraries prior to 21c, pool shrinkage is only initiated when the
130+
pool is accessed. So, pools in fully dormant applications will not shrink
131+
until the application is next used.
132+
133+
The default value is *0*.
134+
135+
See :ref:`conpoolsizing`.
136+
137+
.. versionadded:: 6.9
138+
116139
.. attribute:: pool.poolAlias
117140

118141
This read-only property is a number which specifies the alias of this
@@ -603,12 +626,17 @@ Pool Methods
603626
- :ref:`queueRequests <createpoolpoolattrsqueuerequests>`
604627
- :ref:`queueTimeout <createpoolpoolattrsqueuetimeout>`
605628
- :ref:`sodaMetaDataCache <createpoolpoolattrssodamdcache>` in only Thick mode
629+
- :ref:`maxLifetimeSession <createpoolpoolattrsmaxlifetimesession>`
606630
- :ref:`stmtCacheSize <createpoolpoolattrsstmtcachesize>`
607631

608632
A ``resetStatistics`` property can also be set to *true*. This zeros the current pool statistics, with the exception of ``queueMax`` which is set to the current queue length. Statistics are also reset when statistics recording is turned on with the ``enableStatistics`` property.
609633

610634
Changing ``queueMax``, ``queueTimeout``, or resetting statistics does not affect any currently queued connection requests. If connections are not made available to currently queued requests, those queued requests will timeout based on the ``queueTimeout`` value in effect when they were originally added to the connection pool queue. If pool statistics are enabled, then these failed requests will be counted in :ref:`requestTimeouts <poolstats>` and included in the queue time statistics.
611635

636+
.. versionchanged:: 6.9
637+
638+
The ``maxLifetimeSession`` property was added.
639+
612640
**Callback**:
613641

614642
If you are using the callback programming style::

doc/src/user_guide/connection_handling.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,32 @@ been created, so there is an initial time cost. However it can allow subsequent
14721472
connection requests to be immediately satisfied. In this growth scenario, a
14731473
``poolIncrement`` of 0 is treated as 1.
14741474

1475+
The optional pool creation property
1476+
:ref:`maxLifetimeSession <createpoolpoolattrsmaxlifetimesession>` also allows
1477+
pools to shrink. This property bounds the total length of time that a
1478+
connection can exist in a pool after first being created. It is mostly used
1479+
for defensive programming to mitigate against unforeseeable problems that may
1480+
occur with connections. If a connection was created ``maxLifetimeSession`` or
1481+
longer seconds ago, then it will be a candidate for being closed.
1482+
1483+
In node-oracledb Thick mode, Oracle Client libraries 12.1, or later, are
1484+
needed to use
1485+
:ref:`maxLifetimeSession <createpoolpoolattrsmaxlifetimesession>`. Note that
1486+
when using node-oracledb in Thick mode with Oracle Client libraries prior to
1487+
21c, pool shrinkage is only initiated when the pool is accessed. So, pools in
1488+
fully dormant applications will not shrink until the application is next used.
1489+
1490+
If both :ref:`poolTimeout <createpoolpoolattrspooltimeout>` and
1491+
:ref:`maxLifetimeSession <createpoolpoolattrsmaxlifetimesession>` properties
1492+
are set on a pooled connection, the connection will be terminated if either
1493+
the idle timeout happens or the ``maxLifeTimeSession`` setting is exceeded.
1494+
In this case, if connections are idle for more than
1495+
:ref:`poolTimeout <createpoolpoolattrspooltimeout>`, they are dropped only
1496+
when doing so will ensure that :attr:`pool.connectionsOpen` is more than or
1497+
equal to the :attr:`~pool.poolMin` setting. If the connection lifetime
1498+
exceeds :ref:`maxLifetimeSession <createpoolpoolattrsmaxlifetimesession>`
1499+
seconds, it is dropped and a new connection is created in the pool.
1500+
14751501
Connection pool health can be impacted by firewalls, `resource manager <https:
14761502
//www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-2BEF5482-CF97-4A85-BD90
14771503
-9195E41E74EF>`__, or user profile `IDLE_TIME <https://www.oracle.com/pls/
@@ -1888,6 +1914,7 @@ function record the following:
18881914
:header-rows: 1
18891915
:class: wy-table-responsive
18901916
:align: center
1917+
:widths: 10 10 30
18911918
:summary: The first column displays the pool statistics attribute. The second column displays the logStatistics() label. The third column displays the description of the attribute.
18921919
18931920
* - :ref:`Pool Statistics Class <poolstatisticsclass>` Attribute
@@ -1986,6 +2013,9 @@ function record the following:
19862013
* - ``poolTimeout``
19872014
- :attr:`poolTimeout (seconds) <pool.poolTimeout>`
19882015
- The time (in seconds) after which the pool terminates idle connections (unused in the pool).
2016+
* - ``maxLifetimeSession``
2017+
- :attr:`maxLifetimeSession (seconds) <pool.maxLifetimeSession>`
2018+
- The time (in seconds) that a pooled connection can exist in a pool after first being created.
19892019
* - ``queueMax``
19902020
- :attr:`~pool.queueMax`
19912021
- The maximum number of pending :meth:`pool.getConnection()` calls that can be queued.

0 commit comments

Comments
 (0)