Skip to content

Commit 660a144

Browse files
committed
Documentation update on new macOS ARM64 support and Implicit Connection Pooling
1 parent c41ed21 commit 660a144

File tree

3 files changed

+165
-65
lines changed

3 files changed

+165
-65
lines changed

doc/src/user_guide/connection_handling.rst

Lines changed: 61 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,9 +2875,10 @@ servers in :ref:`DRCP <drcp>` or Oracle Connection Manager in Traffic Director
28752875
Mode's (CMAN-TDM) `Proxy Resident Connection Pooling (PRCP)
28762876
<https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-E0032017-03B1-
28772877
4F14-AF9B-BCC87C982DA8>`__. Applications do not need to be modified. The
2878-
feature can be enabled by altering the application's :ref:`connection string
2879-
<connectionstrings>`. Applications do not need to explicitly acquire, or
2880-
release, connections to be able use a DRCP or PRCP pool.
2878+
feature is enabled by adding a ``POOL_BOUNDARY`` parameter to the
2879+
application's :ref:`connection string <connectionstrings>`. Applications do
2880+
not need to explicitly acquire, or release, connections to be able use a DRCP
2881+
or PRCP pool.
28812882
28822883
Implicit connection pooling is available in node-oracledb Thin and
28832884
:ref:`Thick <enablingthick>` modes. It requires Oracle Database
@@ -2890,11 +2891,9 @@ DRCP or PRCP pool when they are actually used by the application to do database
28902891
work. They are internally released back to pool when not in use. This may
28912892
occur between the application's explicit :meth:`oracledb.getConnection()` call
28922893
and :meth:`connection.close()` (or the application's equivalent connection
2893-
release at end-of-scope).
2894-
2895-
The internal connection release can be controlled by setting a value in the
2896-
``POOL_BOUNDARY`` parameter in the :ref:`Easy Connect string <easyconnect>` or
2897-
the :ref:`Connect Descriptor string <embedtns>`. The value can be either:
2894+
release at end-of-scope). The internal connection release can be controlled by
2895+
the value of the ``POOL_BOUNDARY`` connection string parameter, which can be
2896+
either:
28982897
28992898
- *STATEMENT*: If this boundary value is specified, then the connection is
29002899
released back to the DRCP or PRCP pool when the connection is implicitly
@@ -2915,8 +2914,20 @@ the :ref:`Connect Descriptor string <embedtns>`. The value can be either:
29152914
- Run queries that fetch :ref:`LOB <lobhandling>` and
29162915
:ref:`JSON <jsondatatype>` data
29172916
2917+
Inline with DRCP and PRCP best practices regarding session sharing across
2918+
differing applications, you should add a connection string
2919+
``POOL_CONNECTION_CLASS`` parameter, using the same value for all applications
2920+
that are alike.
2921+
2922+
The DRCP and PRCP "purity" used by Implicit Connection Pooling defaults to
2923+
SELF, which allows reuse of the server process session memory for best
2924+
performance. Adding the connection string parameter ``POOL_PURITY=NEW`` will
2925+
change this and cause each use of a connection to recreate the session memory.
2926+
29182927
.. _useimplicitconnpool:
29192928
2929+
**Configuring Implicit Connection Pooling**
2930+
29202931
To use implicit connection pooling in node-oracledb with DRCP:
29212932
29222933
1. Enable DRCP in the database. For example in SQL*Plus::
@@ -2954,32 +2965,54 @@ To use implicit connection pooling in node-oracledb with DRCP:
29542965
transaction boundary to release the connections back to the DRCP or PRCP
29552966
pool.
29562967
2957-
If you specify an invalid ``POOL_BOUNDARY`` in the
2958-
:ref:`Easy Connect string <easyconnect>` or the
2959-
:ref:`Connect Descriptor string <embedtns>`, then the following error is
2960-
returned::
2968+
.. note::
29612969
2962-
ORA-24545: invalid value of POOL_BOUNDARY specified in connect
2963-
string
2970+
Implicit connection pooling is not enabled if the application sets the
2971+
``POOL_BOUNDARY`` attribute to *TRANSACTION* or *STATEMENT* but does
2972+
not set the ``SERVER=POOLED`` attribute in the connection string.
29642973
2965-
.. note::
2974+
If you specify an invalid ``POOL_BOUNDARY`` in the
2975+
:ref:`Easy Connect string <easyconnect>` or the
2976+
:ref:`Connect Descriptor string <embedtns>`, then the following error is
2977+
returned::
2978+
2979+
ORA-24545: invalid value of POOL_BOUNDARY specified in connect string
2980+
2981+
3. Set the connection class in:
2982+
2983+
- The ``connectString`` property of :meth:`oracledb.getConnection()` or
2984+
:meth:`oracledb.createPool()` in the
2985+
:ref:`Easy Connect string <easyconnect>`. For example, to use a class
2986+
name 'myapp':
2987+
2988+
.. code-block:: javascript
2989+
2990+
const connection = await oracledb.getConnection({
2991+
user : "hr",
2992+
password : mypw, // mypw contains the hr schema password
2993+
connectString : "mydbmachine.example.com:1521/orclpdb1:pooled?pool_boundary=statement&pool_connection_class=myapp"
2994+
});
2995+
2996+
- Or the ``CONNECT_DATA`` section of the :ref:`Connect Descriptor string
2997+
<embedtns>`. For example, to use a class name 'myapp'::
2998+
2999+
tnsalias = (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mymachine.example.com)
3000+
(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)
3001+
(SERVER=POOLED)(POOL_BOUNDARY=TRANSACTION)
3002+
(POOL_CONNECTION_CLASS=myapp)))
29663003
2967-
- Implicit connection pooling is disabled if the application sets the
2968-
``POOL_BOUNDARY`` attribute to *TRANSACTION* or *STATEMENT* but
2969-
does not set the ``SERVER=POOLED`` attribute in the connection string.
3004+
Use the same connection class name for application processes of the same
3005+
type where you want session memory to be reused for connections.
29703006
2971-
- For all the ``POOL_BOUNDARY`` options, the default purity is set to
2972-
*SELF*. You can specify the purity using the ``POOL_PURITY`` parameter
2973-
in the connection string to override the default purity value.
3007+
The pool purity can also optionally be changed by adding ``POOL_PURITY=NEW``
3008+
to the connection string or descriptor.
29743009
29753010
Similar steps can be used with PRCP. For general information on PRCP, see the
29763011
technical brief `CMAN-TDM — An Oracle Database connection proxy for scalable
29773012
and highly available applications <https://download.oracle.com/
29783013
ocomdocs/global/CMAN_TDM_Oracle_DB_Connection_Proxy_for_scalable_apps.pdf>`__.
29793014
2980-
It is recommended to use node-oracledb's local :ref:`connpooling` where
2981-
possible instead of implicit connection pooling. This gives multi-user
2982-
applications more control over pooled server reuse.
3015+
**Implicit Pooling Notes**
29833016
29843017
You should thoroughly test your application when using implicit connection
29853018
pooling to ensure that the internal reuse of database servers does not cause
@@ -2990,6 +3023,10 @@ lifetime of the application connection because different servers may be used
29903023
at different times. Another example is when using a statement boundary of
29913024
*transaction*. In this scenario, any commit can invalidate open cursors.
29923025
3026+
It is recommended to use node-oracledb's local :ref:`connpooling` where
3027+
possible instead of implicit connection pooling. This gives multi-user
3028+
applications more control over pooled server reuse.
3029+
29933030
.. _privconn:
29943031
29953032
Privileged Connections

doc/src/user_guide/initialization.rst

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ On macOS, the alternative ways to enable Thick mode are:
194194
.. code-block:: javascript
195195
196196
const oracledb = require('oracledb');
197-
oracledb.initOracleClient({libDir: process.env.HOME + '/Downloads/instantclient_19_16'});
197+
oracledb.initOracleClient({libDir: process.env.HOME + '/Downloads/instantclient_23_3'});
198198
199199
This directory should contain the libraries from an unzipped `Instant
200200
Client 'Basic' or 'Basic Light' <https://www.oracle.com/database/
@@ -224,20 +224,14 @@ On macOS, the alternative ways to enable Thick mode are:
224224
in the ``node_modules/oracledb/build/Release`` directory where the
225225
``oracledb*.node`` binary is. For example::
226226

227-
ln -s ~/Downloads/instantclient_19_16/libclntsh.dylib node_modules/oracledb/build/Release
227+
ln -s ~/Downloads/instantclient_23_3/libclntsh.dylib node_modules/oracledb/build/Release
228228

229229
This can be added to your ``package.json`` files::
230230

231231
"scripts": {
232232
"postinstall": "ln -s $HOME/Downloads/instantclient_19_16/libclntsh.dylib $(npm root)/oracledb/build/Release"
233233
},
234234

235-
Instead of linking, you can also copy all the required OCI libraries,
236-
for example::
237-
238-
cp ~/Downloads/instantclient_19_16/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libnnz19.dylib,libociei.dylib} node_modules/oracledb/build/Release
239-
cd node_modules/oracledb/build/Release/ && ln -s libclntsh.dylib.19.1 libclntsh.dylib
240-
241235
With the libraries in place, your application can then enable Thick mode:
242236

243237
.. code:: javascript
@@ -251,13 +245,7 @@ On macOS, the alternative ways to enable Thick mode are:
251245
it. For example::
252246

253247
mkdir /usr/local/lib
254-
ln -s ~/Downloads/instantclient_19_16/libclntsh.dylib/usr/local/lib
255-
256-
Instead of linking, you can also copy all the required OCI libraries,
257-
for example::
258-
259-
mkdir /usr/local/lib
260-
cp ~/Downloads/instantclient_19_16/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libnnz19.dylib,libociei.dylib} /usr/local/lib/
248+
ln -s ~/Downloads/instantclient_23_3/libclntsh.dylib /usr/local/lib
261249

262250
With the libraries in place, your application can then enable Thick mode:
263251

doc/src/user_guide/installation.rst

Lines changed: 101 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,8 @@ available in :ref:`Thick mode <featuresummary>`, you need to install Oracle
751751
Client libraries. Thick mode uses a binary add-on installed with node-oracledb
752752
that loads these libraries. This binary is available for macOS Intel only.
753753

754-
Download the **Basic** 64-bit DMG from `Oracle Technology Network <https://www.
755-
oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.
756-
html>`__.
754+
You can get the libraries from either the Oracle Instant Client **Basic** or
755+
**Basic Light** package. The steps below show installing **Basic**.
757756

758757
.. note::
759758

@@ -766,44 +765,89 @@ html>`__.
766765
const oracledb = require('oracledb');
767766
oracledb.initOracleClient();
768767
769-
Manual Installation
770-
+++++++++++++++++++
768+
Instant Client Scripted Installation on macOS ARM64
769+
+++++++++++++++++++++++++++++++++++++++++++++++++++
771770

772-
1. In Finder, double click on the DMG to mount it.
771+
Instant Client installation can be scripted. Open a terminal window and run:
773772

774-
2. Open a terminal window and run the install script in the mounted
775-
package, for example::
773+
.. code-block:: shell
776774
777-
$ /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru/install_ic.sh
775+
cd $HOME/Downloads
776+
curl -O https://download.oracle.com/otn_software/mac/instantclient/233023/instantclient-basic-macos.arm64-23.3.0.23.09.dmg
777+
hdiutil mount instantclient-basic-macos.arm64-23.3.0.23.09.dmg
778+
/Volumes/instantclient-basic-macos.arm64-23.3.0.23.09/install_ic.sh
779+
hdiutil unmount /Volumes/instantclient-basic-macos.arm64-23.3.0.23.09
778780
779-
This copies the contents to ``$HOME/Downloads/instantclient_19_8``.
780-
Applications may not have access to the ``Downloads`` directory, so you
781-
should move Instant Client somewhere convenient.
781+
Note you should use the latest DMG available.
782782

783-
3. In Finder, eject the mounted Instant Client package.
783+
If you have multiple Instant Client DMG packages mounted, you only need to run
784+
``install_ic.sh`` once. It will copy all mounted Instant Client DMG packages
785+
at the same time.
784786

785-
4. Call :meth:`oracledb.initOracleClient()` to enable Thick mode, see
787+
The Instant Client directory will be like
788+
``$HOME/Downloads/instantclient_23_3``. Applications may not have access to
789+
the ``Downloads`` directory, so you should move Instant Client somewhere
790+
convenient.
791+
792+
Call :meth:`oracledb.initOracleClient()` to enable Thick mode, see
793+
:ref:`oracleclientloadingmacos`.
794+
795+
If you use the optional Oracle configuration files, see
796+
:ref:`usingconfigfiles`.
797+
798+
Instant Client Manual Installation on macOS ARM64
799+
+++++++++++++++++++++++++++++++++++++++++++++++++
800+
801+
1. Download the latest Instant Client **Basic** ARM64 package DMG from `Oracle
802+
<https://www.oracle.com/database/technologies/instant-client/macos-arm64-
803+
downloads.html>`__.
804+
805+
2. Using Finder, double-click the DMG to mount it.
806+
807+
3. Open a terminal window and run the install script in the mounted package,
808+
for example if you downloaded version 23.3:
809+
810+
.. code-block:: shell
811+
812+
/Volumes/instantclient-basic-macos.arm64-23.3.0.23.09/install_ic.sh
813+
814+
The Instant Client directory will be like
815+
``$HOME/Downloads/instantclient_23_3``. Applications may not have access to
816+
the ``Downloads`` directory, so you should move Instant Client somewhere
817+
convenient.
818+
819+
4. Using Finder, eject the mounted Instant Client package.
820+
821+
5. Call :meth:`oracledb.initOracleClient()` to enable Thick mode, see
786822
:ref:`oracleclientloadingmacos`.
787823

788-
5. If you use the optional Oracle configuration files, see
824+
6. If you use the optional Oracle configuration files, see
789825
:ref:`usingconfigfiles`.
790826

791-
If you have multiple Instant Client DMG packages mounted, you only need
792-
to run ``install_ic.sh`` once. It will copy all mounted Instant Client
793-
DMG packages at the same time.
827+
If you have multiple Instant Client DMG packages mounted, you only need to run
828+
``install_ic.sh`` once. It will copy all mounted Instant Client DMG packages
829+
at the same time.
830+
831+
Instant Client Scripted Installation on macOS Intel x86-64
832+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
794833

795-
Scripted Installation
796-
+++++++++++++++++++++
834+
Instant Client installation can be scripted. Open a terminal window and run:
797835

798-
Instant Client installation can alternatively be scripted, for example::
836+
.. code-block:: shell
799837
800838
cd $HOME/Downloads
801-
curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
802-
hdiutil mount instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
803-
/Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru/install_ic.sh
804-
hdiutil unmount /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru
839+
curl -O https://download.oracle.com/otn_software/mac/instantclient/1916000/instantclient-basic-macos.x64-19.16.0.0.0dbru.dmg
840+
hdiutil mount instantclient-basic-macos.x64-19.16.0.0.0dbru.dmg
841+
/Volumes/instantclient-basic-macos.x64-19.16.0.0.0dbru/install_ic.sh
842+
hdiutil unmount /Volumes/instantclient-basic-macos.x64-19.16.0.0.0dbru
843+
844+
Note you should use the latest DMG available.
805845

806-
The Instant Client directory will be ``$HOME/Downloads/instantclient_19_8``.
846+
If you have multiple Instant Client DMG packages mounted, you only need to run
847+
``install_ic.sh`` once. It will copy all mounted Instant Client DMG packages at
848+
the same time.
849+
850+
The Instant Client directory will be ``$HOME/Downloads/instantclient_19_16``.
807851
Applications may not have access to the ``Downloads`` directory, so you should
808852
move Instant Client somewhere convenient.
809853

@@ -813,6 +857,37 @@ Call :meth:`oracledb.initOracleClient()` to enable Thick mode, see
813857
If you use the optional Oracle configuration files, see
814858
:ref:`usingconfigfiles`.
815859

860+
Instant Client Manual Installation on macOS Intel x86-64
861+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
862+
863+
1. Download the latest Instant Client **Basic** Intel 64-bit package DMG from
864+
`Oracle <https://www.oracle.com/database/technologies/instant-client/macos-
865+
intel-x86-downloads.html>`__.
866+
867+
2. Using Finder, double-click the DMG to mount it.
868+
869+
3. Open a terminal window and run the install script in the mounted package, for example:
870+
871+
.. code-block:: shell
872+
873+
/Volumes/instantclient-basic-macos.x64-19.16.0.0.0dbru/install_ic.sh
874+
875+
The Instant Client directory will be ``$HOME/Downloads/instantclient_19_16``.
876+
Applications may not have access to the ``Downloads`` directory, so you
877+
should move Instant Client somewhere convenient.
878+
879+
4. Using Finder, eject the mounted Instant Client package.
880+
881+
5. Call :meth:`oracledb.initOracleClient()` to enable Thick mode, see
882+
:ref:`oracleclientloadingmacos`.
883+
884+
6. If you use the optional Oracle configuration files, see
885+
:ref:`usingconfigfiles`.
886+
887+
If you have multiple Instant Client DMG packages mounted, you only need to run
888+
``install_ic.sh`` once. It will copy all mounted Instant Client DMG packages at
889+
the same time.
890+
816891
.. _windowsinstallation:
817892

818893
Installing Node.js and node-oracledb on Microsoft Windows

0 commit comments

Comments
 (0)