Skip to content

Commit 6b86d9b

Browse files
Doc tweaks.
1 parent 3ebf833 commit 6b86d9b

File tree

2 files changed

+79
-15
lines changed

2 files changed

+79
-15
lines changed

doc/src/user_guide/asyncio.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ useful tips.
2424

2525
The python-oracledb asynchronous API is a part of the standard python-oracledb
2626
module. All the synchronous methods that require a round-trip to the database
27-
now have corresponding asynchronous counterparts. You can choose whether to
28-
use the synchronous API or the asynchronous API in your code. It is
29-
recommended to *not* use both at the same time in your application.
27+
have corresponding asynchronous counterparts. You can choose whether to use the
28+
synchronous API or the asynchronous API in your code. It is recommended to
29+
*not* use both at the same time in your application.
3030

3131
The asynchronous API classes are :ref:`AsyncConnection <asyncconnobj>`,
3232
:ref:`AsyncConnectionPool <asyncconnpool>`,

doc/src/user_guide/connection_handling.rst

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,12 +2060,77 @@ dblatest&id=GUID-06022729-9210-4895-BF04-6177713C65A7>`__.
20602060
Connection Pooling
20612061
==================
20622062

2063-
Python-oracledb's connection pooling lets applications create and maintain a
2064-
pool of open connections to the database. Connection pooling is available in
2065-
both Thin and :ref:`Thick <enablingthick>` modes. Connection pooling is
2066-
important for performance and scalability when applications need to handle a
2067-
large number of users who do database work for short periods of time but have
2068-
relatively long periods when the connections are not needed. The high
2063+
Connection pooling can significantly improve application performance and
2064+
scalability, allows resource sharing, and lets applications use advanced Oracle
2065+
High Availability features.
2066+
2067+
The pooling solutions available to python-oracledb applications are:
2068+
2069+
- :ref:`Driver Connection Pools <driverconnpool>`: These are managed by the
2070+
driver layer. They provide readily available database connections that can be
2071+
shared by multiple users and are quick for applications to obtain. They help
2072+
make applications scalable and highly available. They are created with
2073+
:meth:`oracledb.create_pool()` or :meth:`oracledb.create_pool_async()`.
2074+
2075+
The main use case is for applications that hold connections for relatively
2076+
short durations while doing database work, and that acquire and release
2077+
connections back to the pool as needed to do those database operations.
2078+
Using a driver pool is recommended for applications that need to support
2079+
multiple users. High availability benefits also make driver pools useful for
2080+
single-user applications that do infrequent database operations.
2081+
2082+
- :ref:`drcp`: This is pooling of server processes on the database host so they
2083+
can be shared between application connections. This reduces the number of
2084+
server processes that the database host needs to manage.
2085+
2086+
DRCP is useful if there are large number of application connections,
2087+
typically from having multiple application processes, and those applications
2088+
do frequent connection acquire and release calls as needed to do database
2089+
operations. It is recommended to use DRCP in conjunction with a driver
2090+
connection pool, since this reduces the number of re-authentications and
2091+
session memory re-allocations.
2092+
2093+
- `Proxy Resident Connection Pooling (PRCP)
2094+
<https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-E0032017-03B1-
2095+
4F14-AF9B-BCC87C982DA8>`__: This is connection pooling handled by a dedicated
2096+
mid-tier connection proxy, `CMAN-TDM <https://download.oracle.com/
2097+
ocomdocs/global/CMAN_TDM_Oracle_DB_Connection_Proxy_for_scalable_
2098+
apps.pdf>`__.
2099+
2100+
This is useful for applications taking advantage of CMAN-TDM.
2101+
2102+
- :ref:`implicitconnpool`: This can add pooling benefits to applications that
2103+
connect when they start, and only close the connection when the application
2104+
terminates — but relatively infrequently do database work. It makes use of
2105+
DRCP or PRCP, but instead of relying on the application to explicitly acquire
2106+
and release connections, Implicit Connection Pooling automatically detects
2107+
when applications are not performing database work. It then allows the
2108+
associated database server process to be used by another connection that
2109+
needs to do a database operation.
2110+
2111+
Implicit Connection Pooling is useful for legacy applications or third-party
2112+
code that cannot be updated to use a driver connection pool.
2113+
2114+
Python-oracledb :ref:`driver connection pools <driverconnpool>` are the first
2115+
choice for performance, scalability, and high availability. If your database
2116+
is under memory pressure from having too many applications opening too many
2117+
connections, then consider either :ref:`DRCP <drcp>` or :ref:`Implicit
2118+
Connection Pooling <implicitconnpool>`, depending on your application’s
2119+
connection life-cycle. If you are utilizing CMAN-TDM, then using `PRCP
2120+
<https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-
2121+
E0032017-03B1-4F14-AF9B-BCC87C982DA8>`__ can be considered.
2122+
2123+
.. _driverconnpool:
2124+
2125+
Driver Connection Pooling
2126+
-------------------------
2127+
2128+
Python-oracledb's driver connection pooling lets applications create and
2129+
maintain a pool of open connections to the database. Connection pooling is
2130+
available in both Thin and :ref:`Thick <enablingthick>` modes. Connection
2131+
pooling is important for performance and scalability when applications need to
2132+
handle a large number of users who do database work for short periods of time
2133+
but have relatively long periods when the connections are not needed. The high
20692134
availability features of pools also make small pools useful for applications
20702135
that want a few connections available for infrequent use and requires them to
20712136
be immediately usable when acquired. Applications that would benefit from
@@ -2081,20 +2146,19 @@ Oracle Database features, for example some advanced :ref:`high availability
20812146

20822147
.. note::
20832148

2084-
Python-oracledb connection pools must be created, used and closed within
2085-
the same process. Sharing pools or connections across processes has
2149+
Python-oracledb driver connection pools must be created, used, and closed
2150+
within the same process. Sharing pools or connections across processes has
20862151
unpredictable behavior.
20872152

20882153
Using connection pools in multi-threaded architectures is supported.
20892154

20902155
Multi-process architectures that cannot be converted to threading may get
20912156
some benefit from :ref:`drcp`.
20922157

2093-
20942158
Creating a Connection Pool
2095-
--------------------------
2159+
++++++++++++++++++++++++++
20962160

2097-
A connection pool is created by calling :meth:`oracledb.create_pool()`.
2161+
A driver connection pool is created by calling :meth:`oracledb.create_pool()`.
20982162
Various pool options can be specified as described in
20992163
:meth:`~oracledb.create_pool()` and detailed below.
21002164

@@ -2786,7 +2850,7 @@ sharing for applications which use a large number of connections that run in
27862850
multiple client processes or run on multiple middle-tier application servers.
27872851
By default, each connection from Python will use one database server process.
27882852
DRCP allows pooling of these server processes. This reduces the amount of
2789-
memory required on the database host. The DRCP pool can be shared by multiple
2853+
memory required on the database host. A DRCP pool can be shared by multiple
27902854
applications.
27912855

27922856
DRCP is useful for applications which share the same database credentials, have

0 commit comments

Comments
 (0)