@@ -43,6 +43,8 @@ limitations under the License.
43
43
- [ ` SUBSCR_EVENT_TYPE_DEREG ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_EVENT_TYPE_OBJ_CHANGE ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_EVENT_TYPE_QUERY_CHANGE ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_EVENT_TYPE_AQ ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_GROUPING_CLASS_TIME ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_GROUPING_TYPE_SUMMARY ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_GROUPING_TYPE_LAST ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_QOS_BEST_EFFORT ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_QOS_DEREG_NFY ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_QOS_QUERY ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_QOS_RELIABLE ` ] ( #oracledbconstantssubscription ) , [ ` SUBSCR_QOS_ROWIDS ` ] ( #oracledbconstantssubscription )
44
44
- 3.1.8 [ Continuous Query Notification Constants] ( #oracledbconstantscqn )
45
45
- [ ` CQN_OPCODE_ALL_OPS ` ] ( #oracledbconstantscqn ) , [ ` CQN_OPCODE_ALL_ROWS ` ] ( #oracledbconstantscqn ) , [ ` CQN_OPCODE_ALTER ` ] ( #oracledbconstantscqn ) , [ ` CQN_OPCODE_DELETE ` ] ( #oracledbconstantscqn ) , [ ` CQN_OPCODE_DROP ` ] ( #oracledbconstantscqn ) , [ ` CQN_OPCODE_INSERT ` ] ( #oracledbconstantscqn ) , [ ` CQN_OPCODE_UPDATE ` ] ( #oracledbconstantscqn )
46
+ - 3.1.9 [ Pool Status Constants] ( #oracledbconstantspool )
47
+ - [ ` POOL_STATUS_OPEN ` ] ( #oracledbconstantspool ) , [ ` POOL_STATUS_DRAINING ` ] ( #oracledbconstantspool ) , [ ` POOL_STATUS_CLOSED ` ] ( #oracledbconstantspool )
46
48
- 3.2 [ Oracledb Properties] ( #oracledbproperties )
47
49
- 3.2.1 [ ` autoCommit ` ] ( #propdbisautocommit )
48
50
- 3.2.2 [ ` connectionClass ` ] ( #propdbconclass )
@@ -199,7 +201,8 @@ limitations under the License.
199
201
- 6.1.8 [ ` poolTimeout ` ] ( #proppoolpooltimeout )
200
202
- 6.1.9 [ ` queueRequests ` ] ( #proppoolqueuerequests )
201
203
- 6.1.10 [ ` queueTimeout ` ] ( #proppoolqueueTimeout )
202
- - 6.1.11 [ ` stmtCacheSize ` ] ( #proppoolstmtcachesize )
204
+ - 6.1.11 [ ` status ` ] ( #proppoolstatus )
205
+ - 6.1.12 [ ` stmtCacheSize ` ] ( #proppoolstmtcachesize )
203
206
- 6.2 [ Pool Methods] ( #poolmethods )
204
207
- 6.2.1 [ ` close() ` ] ( #poolclose )
205
208
- 6.2.2 [ ` getConnection() ` ] ( #getconnectionpool )
@@ -655,6 +658,16 @@ Constant Name | Value |Description
655
658
` oracledb.CQN_OPCODE_INSERT ` | 2 | Set if the notifying transaction included inserts on the table
656
659
` oracledb.CQN_OPCODE_UPDATE ` | 4 | Set if the notifying transaction included updates on the table
657
660
661
+ #### <a name =" oracledbconstantspool " ></a > 3.1.9 Pool Status Constants
662
+
663
+ Constants for the connection [ ` pool.status ` ] ( #proppoolstatus ) readonly attribute.
664
+
665
+ Constant Name | Value |Description
666
+ --------------------------------|-------|---------------------------------------------------
667
+ ` oracledb.POOL_STATUS_OPEN ` | 6000 | The connection pool is open.
668
+ ` oracledb.POOL_STATUS_DRAINING ` | 6001 | The connection pool is being drained of in-use connections and will be force closed soon.
669
+ ` oracledb.POOL_STATUS_CLOSED ` | 6002 | The connection pool has been closed.
670
+
658
671
### <a name =" oracledbproperties " ></a > 3.2 Oracledb Properties
659
672
660
673
The properties of the * Oracledb* object are used for setting up
@@ -1402,7 +1415,7 @@ pass the pool object through code.
1402
1415
See [ Connection Pool Cache] ( #connpoolcache ) for more details.
1403
1416
1404
1417
A pool should be terminated with the [ ` pool.close() ` ] ( #poolclose )
1405
- call, but only after all connections have been released .
1418
+ call.
1406
1419
1407
1420
See [ Connection Pooling] ( #connpooling ) for more information about pooling.
1408
1421
@@ -3500,7 +3513,17 @@ the queue before the request is terminated.
3500
3513
3501
3514
See [ ` oracledb.queueTimeout ` ] ( #propdbqueuetimeout ) .
3502
3515
3503
- #### <a name =" proppoolstmtcachesize " ></a > 6.1.11 ` pool.stmtCacheSize `
3516
+ #### <a name =" proppoolstatus " ></a > 6.1.11 ` pool.status `
3517
+
3518
+ ```
3519
+ readonly Number status
3520
+ ```
3521
+
3522
+ One of the [ Pool Status Constants] ( #oracledbconstantspool ) indicating
3523
+ whether the pool is open, being drained of in-use connections, or has
3524
+ been closed.
3525
+
3526
+ #### <a name =" proppoolstmtcachesize " ></a > 6.1.12 ` pool.stmtCacheSize `
3504
3527
3505
3528
```
3506
3529
readonly Number stmtCacheSize
@@ -3519,27 +3542,58 @@ See [`oracledb.stmtCacheSize`](#propdbstmtcachesize).
3519
3542
3520
3543
Callback:
3521
3544
```
3522
- close(function(Error error){});
3545
+ close([Number drainTime,] function(Error error){});
3523
3546
```
3524
3547
Promise:
3525
3548
```
3526
- promise = close();
3549
+ promise = close([Number drainTime] );
3527
3550
```
3528
3551
3529
3552
##### Description
3530
3553
3531
- This call terminates the connection pool.
3532
-
3533
- Any open connections should be released with [ ` connection.close() ` ] ( #connectionclose )
3534
- before ` pool.close() ` is called.
3554
+ This call closes connections in the pool and terminates the connection
3555
+ pool.
3535
3556
3536
- If the pool is in the [ connection pool cache] ( #connpoolcache ) it will be removed from the cache.
3557
+ If a ` drainTime ` is not given, then any open connections should be
3558
+ released with [ ` connection.close() ` ] ( #connectionclose ) before
3559
+ ` pool.close() ` is called, otherwise the pool close will fail and the
3560
+ pool will remain open.
3561
+
3562
+ If a ` drainTime ` is specified, then any new ` pool.getConnection() `
3563
+ calls will fail. If connections are in use by the application, they
3564
+ can continue to be used for the specified number of seconds, after
3565
+ which the pool and all open connections are forcibly closed. Prior to
3566
+ this time limit, if there are no connections currently "checked out"
3567
+ from the pool with ` getConnection() ` , then the pool and any
3568
+ connections that are idle in the pool are immediately closed.
3569
+ Non-zero ` drainTime ` values are strongly recommended so applications
3570
+ have the opportunity to gracefully finish database operations. A
3571
+ ` drainTime ` of 0 may be used to close a pool and its connections
3572
+ immediately.
3573
+
3574
+ In network configurations that drop (or in-line) out-of-band breaks,
3575
+ forced pool termination may hang unless you have
3576
+ [ ` DISABLE_OOB=ON ` ] [ 301 ] in a ` sqlnet.ora ` file, see [ Optional Client
3577
+ Configuration Files] ( #tnsadmin ) .
3578
+
3579
+ When the pool is closed, it will be removed from the [ connection pool
3580
+ cache] ( #connpoolcache ) .
3537
3581
3538
3582
This method was added to node-oracledb 1.9, replacing the equivalent
3539
3583
alias ` pool.terminate() ` .
3540
3584
3585
+ The ` drainTime ` parameter was added in node-oracledb 3.0.
3586
+
3541
3587
##### Parameters
3542
3588
3589
+ ```
3590
+ Number drainTime
3591
+ ```
3592
+
3593
+ The number of seconds before the pool and connections are force closed.
3594
+
3595
+ If ` drainTime ` is 0, the pool and its connections are closed immediately.
3596
+
3543
3597
```
3544
3598
function(Error error)
3545
3599
```
@@ -4337,7 +4391,7 @@ still waiting in the queue.
4337
4391
4338
4392
##### Attribute Values
4339
4393
4340
- The ` _logStats ()` method also shows attribute values in effect for the pool:
4394
+ The ` _logStats ()` method also shows attribute values of the pool:
4341
4395
4342
4396
Attribute |
4343
4397
--------------------------------------------|
@@ -4350,6 +4404,14 @@ Attribute |
4350
4404
[` poolPingInterval` ](#propdbpoolpinginterval) |
4351
4405
[` stmtCacheSize` ](#propdbstmtcachesize) |
4352
4406
4407
+ ##### Pool Status
4408
+
4409
+ The ` _logStats ()` method also shows the pool status:
4410
+
4411
+ Attribute |
4412
+ ----------------------------|
4413
+ [` status` ](#proppoolstatus) |
4414
+
4353
4415
##### Related Environment Variables
4354
4416
4355
4417
One related environment variable is is shown by ` _logStats ()` :
@@ -8930,3 +8992,5 @@ When upgrading from node-oracledb version 2.0 to version 2.1:
8930
8992
[100]: https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-ABC7AE4D-64A8-4EA9-857D-BEF7300B64C3
8931
8993
[101]: https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-2BEF5482-CF97-4A85-BD90-9195E41E74EF
8932
8994
[102]: https://github.com/oracle/node-oracledb/issues/886
8995
+
8996
+ [301]: https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-4DD81A76-8D7D-4DEF-9DC1-77212C657AAF
0 commit comments