@@ -2060,12 +2060,77 @@ dblatest&id=GUID-06022729-9210-4895-BF04-6177713C65A7>`__.
2060
2060
Connection Pooling
2061
2061
==================
2062
2062
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
2069
2134
availability features of pools also make small pools useful for applications
2070
2135
that want a few connections available for infrequent use and requires them to
2071
2136
be immediately usable when acquired. Applications that would benefit from
@@ -2081,20 +2146,19 @@ Oracle Database features, for example some advanced :ref:`high availability
2081
2146
2082
2147
.. note ::
2083
2148
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
2086
2151
unpredictable behavior.
2087
2152
2088
2153
Using connection pools in multi-threaded architectures is supported.
2089
2154
2090
2155
Multi-process architectures that cannot be converted to threading may get
2091
2156
some benefit from :ref: `drcp `.
2092
2157
2093
-
2094
2158
Creating a Connection Pool
2095
- --------------------------
2159
+ ++++++++++++++++++++++++++
2096
2160
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() `.
2098
2162
Various pool options can be specified as described in
2099
2163
:meth: `~oracledb.create_pool() ` and detailed below.
2100
2164
@@ -2786,7 +2850,7 @@ sharing for applications which use a large number of connections that run in
2786
2850
multiple client processes or run on multiple middle-tier application servers.
2787
2851
By default, each connection from Python will use one database server process.
2788
2852
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
2790
2854
applications.
2791
2855
2792
2856
DRCP is useful for applications which share the same database credentials, have
0 commit comments