Skip to content

Commit c21e781

Browse files
Final tweaks to documentation on enable_thin_mode().
1 parent dc2b383 commit c21e781

File tree

3 files changed

+31
-26
lines changed

3 files changed

+31
-26
lines changed

doc/src/api_manual/module.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,16 +1896,15 @@ Oracledb Methods
18961896

18971897
Makes python-oracledb be in Thin mode. After this method is called, Thick
18981898
mode cannot be enabled. If python-oracledb is already in Thick mode, then
1899-
calling ``enable_thin_mode()`` will fail. If connections have already been
1900-
opened, or a connection pool created, in Thin mode, then calling
1901-
``enable_thin_mode()`` is a no-op.
1899+
calling ``enable_thin_mode()`` will fail. If Thin mode connections have
1900+
already been opened, or a connection pool created in Thin mode, then
1901+
calling ``enable_thin_mode()`` is a no-op.
19021902

19031903
Since python-oracledb defaults to Thin mode, almost all applications do not
19041904
need to call this method. However, because it bypasses python-oracledb's
19051905
internal mode-determination heuristic, it may be useful for applications
1906-
that are using :ref:`standalone connections <standaloneconnection>` in
1907-
multiple threads to concurrently create connections when the application
1908-
starts.
1906+
with multiple threads that concurrently create :ref:`standalone connections
1907+
<standaloneconnection>` when the application starts.
19091908

19101909
See :ref:`enablingthin` for more information.
19111910

doc/src/release_notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Thin Mode Changes
3838
python-oracledb Thin mode without waiting for an initial connection to be
3939
succesfully established. Since python-oracledb defaults to Thin mode, this
4040
method is mostly useful for applications with multiple threads concurrently
41-
creating connections to different databases when the application starts
41+
creating connections to databases when the application starts
4242
(`issue 408 <https://github.com/oracle/python-oracledb/issues/408>`__).
4343
#) Fixed bug when calling :meth:`Connection.gettype()` for a type that exists
4444
but on which the user has insufficient privileges to view

doc/src/user_guide/initialization.rst

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -317,28 +317,34 @@ going to be used. In one special case, you may wish to explicitly enable Thin
317317
mode to prevent Thick mode from being enabled later.
318318

319319
To allow application portability, the driver's internal logic allows
320-
applications to initally attempt
321-
:ref:`standalone connection <standaloneconnection>` creation in Thin mode, but
322-
then lets them :ref:`enable Thick mode <enablingthick>` if that connection is
323-
unsuccessful. An example is when trying to connect to an Oracle Database that
324-
turns out to be an old version that requires Thick mode. This heuristic means
325-
Thin mode is not enforced until the initial connection is successful. Since
326-
all connections must be the same mode, any second and subsequent concurrent
327-
Thin mode connection attempts will wait for the initial standalone connection
328-
to succeed, meaning the driver mode is no longer potentially changeable to
329-
Thick mode.
330-
331-
This heuristic delay does not impact:
332-
333-
- Single-threaded applications using standalone connections.
320+
applications to initally attempt :ref:`standalone connection
321+
<standaloneconnection>` creation in Thin mode, but then lets them :ref:`enable
322+
Thick mode <enablingthick>` if that connection is unsuccessful. An example is
323+
when trying to connect to an Oracle Database that turns out to be an old
324+
version that requires Thick mode. This heuristic means Thin mode is not
325+
enforced until the initial connection is successful. Since all connections
326+
must be the same mode, any second and subsequent concurrent Thin mode
327+
connection attempt will wait for the initial standalone connection to succeed,
328+
meaning the driver mode is no longer potentially changeable to Thick mode.
329+
330+
If you have multiple threads concurrently creating standalone Thin mode
331+
connections, you may wish to call :meth:`oracledb.enable_thin_mode()` as part
332+
of your application initialization. This is not required but avoids the mode
333+
determination delay.
334+
335+
The mode determination delay does not affect the following cases, so calling
336+
:meth:`~oracledb.enable_thin_mode()` is not needed for them:
337+
338+
- Single-threaded applications using :ref:`standalone connections
339+
<standaloneconnection>`.
334340
- Single or multi-threaded applications using
335341
:ref:`connection pools <connpooling>` (even with ``min`` of 0).
336-
- Applications that have already called :func:`oracledb.init_oracle_client()`.
337342

338-
In the case that you want to open multiple standalone Thin mode connections in
339-
multiple threads, you may wish to force Thin mode by calling
340-
:meth:`oracledb.enable_thin_mode()` as part of your application initialization.
341-
This avoids the mode heuristic delay. For example:
343+
The delay also does not affect applications that have already called
344+
:func:`oracledb.init_oracle_client()` to enable Thick mode.
345+
346+
To explicitly enable Thin mode, call :meth:`~oracledb.enable_thin_mode()`, for
347+
example:
342348

343349
.. code-block:: python
344350

0 commit comments

Comments
 (0)