Skip to content

Commit d18627e

Browse files
committed
Mention queueing in the pooling doc and mention why prepare/execute are not needed
1 parent 4c77aaa commit d18627e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

doc/api.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,9 @@ oracledb.getConnection(
20522052
20532053
When applications use a lot of connections for short periods, Oracle
20542054
recommends using a connection pool for efficiency. Each node-oracledb
2055-
process can use one or more local pools of connections.
2055+
process can use one or more local pools of connections. Each pool can
2056+
contain one or more connections. A pool can grow or shrink, as
2057+
needed.
20562058
20572059
A connection *Pool* object is created by calling the
20582060
[`createPool()`](#createpool) function of the *Oracledb*
@@ -2108,6 +2110,14 @@ The Pool attribute [`stmtCacheSize`](#propconnstmtcachesize) can be
21082110
used to set the statement cache size used by connections in the pool,
21092111
see [Statement Caching](#stmtcache).
21102112
2113+
If `poolMax` has been reached (meaning all connections in a pool are
2114+
in use), and new [`pool.getConnection()`](#getconnectionpool) requests
2115+
are made, then the requests will be queued until in-use connections
2116+
are released. The queue can disabled by setting the pool property
2117+
[`queueRequests`](#propdbqueuerequests) to `false`. When the queue is
2118+
disabled, `pool.getConnection()` requests that cannot be satisfied
2119+
will return an error.
2120+
21112121
#### <a name="connpoolmonitor"></a> 8.2.1 Connection Pool Monitoring and Throughput
21122122
21132123
Connection pool usage can be monitored to choose the appropriate
@@ -3707,8 +3717,8 @@ statement is executed irrespective of the value of `autoCommit`.
37073717
37083718
## <a name="stmtcache"></a> 14. Statement Caching
37093719
3710-
Node-oracledb uses the
3711-
[Oracle OCI statement cache](https://docs.oracle.com/database/121/LNOCI/oci09adv.htm#i471377).
3720+
Node-oracledb's [`execute()`](#execute) method uses the
3721+
[Oracle OCI statement cache](https://docs.oracle.com/database/121/LNOCI/oci09adv.htm#i471377) instead of requiring applications to prepare and execute statements in separate steps.
37123722
Each non-pooled connection and each session in the connection pool has
37133723
its own cache of statements with a default size of 30. Statement
37143724
caching lets cursors be used without re-parsing the statement.

0 commit comments

Comments
 (0)