@@ -4009,21 +4009,17 @@ When applications use a lot of connections for short periods, Oracle
4009
4009
recommends using a connection pool for efficiency. Each pool can
4010
4010
contain one or more connections. A pool can grow or shrink, as
4011
4011
needed. Each node-oracledb process can use one or more local pools of
4012
- connections.
4013
-
4014
- Pool expansion happens when the following are all true:
4015
- (i) [` getConnection ()` ](#getconnectionpool) is called and (ii) all the
4016
- currently established connections in the pool are "checked out" by
4017
- previous ` getConnection ()` calls and are in-use by the application,
4018
- and (iii) the number of those connections is less than the pool's
4019
- ` poolMax` setting.
4012
+ connections. In addition to providing an immediately available set of
4013
+ connections, pools provide database load balancing capabilities and
4014
+ transparently handles Oracle Database High Availability events,
4015
+ shielding applications from errors during planned maintenance.
4020
4016
4021
4017
A pool is created by calling the
4022
4018
[` oracledb .createPool ()` ](#createpool) method. Internally [Oracle Call
4023
4019
Interface Session Pooling][6] is used.
4024
4020
4025
- A connection is returned with the
4026
- [` pool .getConnection ()` ](#getconnectionpool) function :
4021
+ A connection from the pool is obtained with the
4022
+ [` pool .getConnection ()` ](#getconnectionpool) method :
4027
4023
4028
4024
` ` ` javascript
4029
4025
var oracledb = require (' oracledb' );
@@ -4042,6 +4038,11 @@ oracledb.createPool (
4042
4038
});
4043
4039
` ` `
4044
4040
4041
+ Each connection should be used for a given unit of work, such as a
4042
+ transaction or a set of sequentially executed statements. Remember,
4043
+ statements should be [executed sequentially, not in
4044
+ parallel](#numberofthreads) on each connection.
4045
+
4045
4046
Connections should be released with [` connection .close ()` ](#connectionclose) when no
4046
4047
longer needed:
4047
4048
@@ -4059,6 +4060,13 @@ After an application finishes using a connection pool, it should
4059
4060
release all connections and terminate the connection pool by calling
4060
4061
the [` pool .close ()` ](#poolclose) method.
4061
4062
4063
+ Pool expansion happens when the following are all true:
4064
+ (i) [` getConnection ()` ](#getconnectionpool) is called and (ii) all the
4065
+ currently established connections in the pool are "checked out" by
4066
+ previous ` getConnection ()` calls and are in-use by the application,
4067
+ and (iii) the number of those connections is less than the pool's
4068
+ ` poolMax` setting.
4069
+
4062
4070
The growth characteristics of a connection pool are determined by the
4063
4071
Pool attributes [` poolIncrement` ](#proppoolpoolincrement),
4064
4072
[` poolMax` ](#proppoolpoolmax), [` poolMin` ](#proppoolpoolmin) and
0 commit comments