Skip to content

Commit 7e830c2

Browse files
committed
Some updates to pool doc
1 parent afd83c7 commit 7e830c2

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

doc/api.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4009,21 +4009,17 @@ When applications use a lot of connections for short periods, Oracle
40094009
recommends using a connection pool for efficiency. Each pool can
40104010
contain one or more connections. A pool can grow or shrink, as
40114011
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.
40204016
40214017
A pool is created by calling the
40224018
[`oracledb.createPool()`](#createpool) method. Internally [Oracle Call
40234019
Interface Session Pooling][6] is used.
40244020
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:
40274023
40284024
```javascript
40294025
var oracledb = require('oracledb');
@@ -4042,6 +4038,11 @@ oracledb.createPool (
40424038
});
40434039
```
40444040
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+
40454046
Connections should be released with [`connection.close()`](#connectionclose) when no
40464047
longer needed:
40474048
@@ -4059,6 +4060,13 @@ After an application finishes using a connection pool, it should
40594060
release all connections and terminate the connection pool by calling
40604061
the [`pool.close()`](#poolclose) method.
40614062
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+
40624070
The growth characteristics of a connection pool are determined by the
40634071
Pool attributes [`poolIncrement`](#proppoolpoolincrement),
40644072
[`poolMax`](#proppoolpoolmax), [`poolMin`](#proppoolpoolmin) and

0 commit comments

Comments
 (0)