@@ -1542,6 +1542,10 @@ pool running out of connections.
1542
1542
When a connection is released, any ongoing transaction on the
1543
1543
connection is rolled back.
1544
1544
1545
+ If ResultSets are not released or LOBs are still open when
1546
+ ` connection.close() ` is called, then an error * DPI-1054: connection
1547
+ cannot be closed when open statements or LOBs exist* will occur.
1548
+
1545
1549
After releasing a connection to a pool, there is no
1546
1550
guarantee a subsequent ` getConnection() ` call gets back the same
1547
1551
database connection. The application must redo any ALTER SESSION
@@ -1614,13 +1618,10 @@ be passed into PL/SQL blocks, or inserted into the database.
1614
1618
1615
1619
When no longer required, Lobs created with ` createLob() ` should be
1616
1620
closed with [ ` lob.close() ` ] ( #lobclose ) because Oracle Database
1617
- resources will be held open if temporary LOBs are not closed. If the
1618
- application does not explicitly call ` lob.close() ` , then the temporary
1619
- tablespace storage for LOBs created with ` createLob() ` is freed when a
1620
- non-pooled connection is closed, or when a pooled connection is
1621
- removed from a pool due to pool shrinkage or pool termination. The
1622
- temporary tablespace storage is also freed at end of scope, as long as
1623
- the connection is still open.
1621
+ resources are held open if temporary LOBs are not closed. If LOBs are
1622
+ still open when ` connection.close() ` is called, then an error
1623
+ * DPI-1054: connection cannot be closed when open statements or LOBs
1624
+ exist* will occur.
1624
1625
1625
1626
Open temporary LOB usage can be monitored using the view
1626
1627
[ ` V$TEMPORARY_LOBS ` ] [ 13 ] .
@@ -2141,6 +2142,10 @@ LOB, such as those created by `createLob()`.
2141
2142
2142
2143
Once a Lob is closed, it cannot be bound.
2143
2144
2145
+ If LOBs are still open when ` connection.close() ` is called, then an
2146
+ error * DPI-1054: connection cannot be closed when open statements or
2147
+ LOBs exist* will occur.
2148
+
2144
2149
See [ Closing Lobs] ( #closinglobs ) for more discussion.
2145
2150
2146
2151
##### Parameters
@@ -2438,6 +2443,10 @@ Closes a ResultSet. Applications should always call this at the end
2438
2443
of fetch or when no more rows are needed. It should also be called if
2439
2444
no rows are ever going to be fetched from the ResultSet.
2440
2445
2446
+ If you try to close a connection without closing a ResultSet then an
2447
+ error * DPI-1054: connection cannot be closed when open statements or
2448
+ LOBs exist* will occur.
2449
+
2441
2450
#### <a name =" getrow " ></a > 7.2.2 ` resultset.getRow() `
2442
2451
2443
2452
##### Prototype
@@ -3370,9 +3379,12 @@ For ResultSets, the [`maxRows`](#propdbmaxrows) limit is ignored. All
3370
3379
rows can be fetched.
3371
3380
3372
3381
When all rows have been fetched, or the application does not want to
3373
- continue getting more rows, then the ResultSet should be freed
3374
- using [` close ()` ](#close). The ResultSet should also be explicitly
3375
- closed in the cases where no rows will be fetched from it.
3382
+ continue getting more rows, then the ResultSet should be freed using
3383
+ [` close ()` ](#close). The ResultSet should also be explicitly closed
3384
+ in the cases where no rows will be fetched from it. If you try to
3385
+ close a connection without closing a ResultSet then an error
3386
+ *DPI-1054: connection cannot be closed when open statements or LOBs
3387
+ exist* will occur.
3376
3388
3377
3389
REF CURSORS returned from a PL/SQL block via an ` oracledb .CURSOR ` OUT
3378
3390
binds are also available as a ResultSet. See
@@ -4826,12 +4838,7 @@ tablespace storage used by a temporary LOB is released. Once a Lob is
4826
4838
closed, it can no longer be bound or used for streaming.
4827
4839
4828
4840
Lobs created with [` createLob ()` ](#connectioncreatelob) should be
4829
- explicitly closed with [` lob .close ()` ](#lobclose). If not explicitly
4830
- closed, these Lobs are closed when the connection is closed (for
4831
- non-pooled connections), or when a pooled connection is removed from a
4832
- pool due to planned pool shrinkage or pool termination. If
4833
- connections are never removed from the pool, you will have 'LOB leaks'
4834
- and the temporary tablespace will fill up.
4841
+ explicitly closed with [` lob .close ()` ](#lobclose).
4835
4842
4836
4843
Persistent or temporary Lobs returned from the database should be
4837
4844
closed with ` lob .close ()` unless they have been automatically closed.
@@ -4841,18 +4848,21 @@ Automatic closing of returned Lobs occurs when:
4841
4848
- a stream error occurs
4842
4849
- the Lob was used as the source for an IN OUT bind
4843
4850
4844
- If you try to close a Lob
4845
- being used for streaming you will get the error *NJS-023: concurrent
4846
- operations on a Lob are not allowed*.
4851
+ If you try to close a Lob being used for streaming you will get the
4852
+ error *NJS-023: concurrent operations on a Lob are not allowed*.
4847
4853
4848
4854
The connection must be open when calling ` lob .close ()` on a temporary
4849
- LOB. If the connection is closed and temporary LOBs are still open,
4850
- the warning *NJS-049: Temporary LOBs were open when the connection was
4851
- closed* will occur. You should review the application logic and
4852
- explicitly close any open Lobs. These temporary Lobs will have been
4853
- created with ` lob .createLob ()` or returned from the database, perhaps
4854
- as the result of a SQL operation like ` substr ()` on a Lob column.
4855
- Persistent LOBs can be closed without the connection being open.
4855
+ LOB.
4856
+
4857
+ If you try to close a connection without closing an open Lob, then an
4858
+ error *DPI-1054: connection cannot be closed when open statements or
4859
+ LOBs exist* will occur. The error helps prevent 'Temporary LOB leaks'
4860
+ that would cause the temporary tablespace to fill up. You should
4861
+ review the application logic and explicitly close any open Lobs.
4862
+ These temporary Lobs will have been created with ` lob .createLob ()` or
4863
+ returned from the database, perhaps as the result of a SQL operation
4864
+ like ` substr ()` on a Lob column. Persistent LOBs can be closed
4865
+ without the connection being open.
4856
4866
4857
4867
The ` lob .close ()` method emits the [Node.js Stream][16] 'close' event
4858
4868
unless the Lob has already been closed explicitly or automatically.
0 commit comments