Skip to content

Commit d4ca984

Browse files
committed
Added pool.reconfigure()
1 parent bb6fbe2 commit d4ca984

File tree

15 files changed

+3270
-347
lines changed

15 files changed

+3270
-347
lines changed

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,26 @@
66

77
- Connection pool changes:
88

9-
- Fixed connection pool statistics "min time in queue" and "max time in
10-
queue" calculations.
9+
- Pool attributes can be changed during application runtime with
10+
[`pool.reconfigure()`](https://oracle.github.io/node-oracledb/doc/api.html#poolreconfigure).
11+
This lets properties such as the pool size be changed dynamically instead
12+
of having to restart the application or create a new pool.
13+
14+
- Formalized pool statistics with the addition of a pool creation attribute
15+
[`enableStatistics`](https://oracle.github.io/node-oracledb/doc/api.html#createpoolpoolattrsstats),
16+
and with the functions
17+
[`pool.getStatistics()`](https://oracle.github.io/node-oracledb/doc/api.html#poolgetstatistics)
18+
and
19+
[`pool.logStatistics()`](https://oracle.github.io/node-oracledb/doc/api.html#poollogstatistics).
20+
Pool statistics can be be enabled, disabled, or reset with
21+
`pool.reconfigure()`. The older `_enableStats` attribute and
22+
`_logStats()` function are aliases for the new functionality but will be
23+
removed in a future version of node-oracledb.
24+
25+
- Added `currentQueueLength` and `poolMaxPerShard` to the pool statistics.
26+
27+
- Fixed connection pool statistics "minimum time in queue" and "maximum
28+
time in queue" calculations.
1129

1230
- Fixed the statement cache size set for the initial `poolMin` connections
1331
created by `oracledb.createPool()`.

doc/api.md

Lines changed: 445 additions & 194 deletions
Large diffs are not rendered by default.

examples/connectionpool.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async function init() {
7979
// sessionCallback: myFunction, // function invoked for brand new connections or by a connection tag mismatch
8080
// sodaMetaDataCache: false, // Set true to improve SODA collection access performance
8181
// stmtCacheSize: 30, // number of statements that are cached in the statement cache of each connection
82-
// _enableStats: false // record pool usage statistics that can be output with oracledb.getPool()._logStats()
82+
// enableStatistics: false // record pool usage for oracledb.getPool().getStatistics() and logStatistics()
8383
});
8484
console.log('Connection pool started');
8585

@@ -103,7 +103,7 @@ async function dostuff() {
103103
const options = { outFormat: oracledb.OUT_FORMAT_OBJECT };
104104
const result = await connection.execute(sql, binds, options);
105105
console.log(result);
106-
// oracledb.getPool()._logStats(); // show pool statistics. _enableStats must be true
106+
// oracledb.getPool().logStatistics(); // show pool statistics. pool.enableStatistics must be true
107107
} catch (err) {
108108
console.error(err);
109109
} finally {

examples/webapp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async function init() {
8989
// sessionCallback: initSession, // function invoked for brand new connections or by a connection tag mismatch
9090
// sodaMetaDataCache: false, // Set true to improve SODA collection access performance
9191
// stmtCacheSize: 30, // number of statements that are cached in the statement cache of each connection
92-
// _enableStats: false // record pool usage statistics that can be output with oracledb.getPool()._logStats()
92+
// enableStatistics: false // record pool usage for oracledb.getPool().getStatistics() and logStatistics()
9393
});
9494

9595
// create the demo table

0 commit comments

Comments
 (0)