Skip to content

Commit fb0f253

Browse files
committed
Mention DPI-1054 error
1 parent f39fb49 commit fb0f253

File tree

1 file changed

+36
-26
lines changed

1 file changed

+36
-26
lines changed

doc/api.md

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,10 @@ pool running out of connections.
15421542
When a connection is released, any ongoing transaction on the
15431543
connection is rolled back.
15441544

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+
15451549
After releasing a connection to a pool, there is no
15461550
guarantee a subsequent `getConnection()` call gets back the same
15471551
database connection. The application must redo any ALTER SESSION
@@ -1614,13 +1618,10 @@ be passed into PL/SQL blocks, or inserted into the database.
16141618

16151619
When no longer required, Lobs created with `createLob()` should be
16161620
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.
16241625

16251626
Open temporary LOB usage can be monitored using the view
16261627
[`V$TEMPORARY_LOBS`][13].
@@ -2141,6 +2142,10 @@ LOB, such as those created by `createLob()`.
21412142

21422143
Once a Lob is closed, it cannot be bound.
21432144

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+
21442149
See [Closing Lobs](#closinglobs) for more discussion.
21452150

21462151
##### Parameters
@@ -2438,6 +2443,10 @@ Closes a ResultSet. Applications should always call this at the end
24382443
of fetch or when no more rows are needed. It should also be called if
24392444
no rows are ever going to be fetched from the ResultSet.
24402445

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+
24412450
#### <a name="getrow"></a> 7.2.2 `resultset.getRow()`
24422451

24432452
##### Prototype
@@ -3370,9 +3379,12 @@ For ResultSets, the [`maxRows`](#propdbmaxrows) limit is ignored. All
33703379
rows can be fetched.
33713380
33723381
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.
33763388
33773389
REF CURSORS returned from a PL/SQL block via an `oracledb.CURSOR` OUT
33783390
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
48264838
closed, it can no longer be bound or used for streaming.
48274839
48284840
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).
48354842
48364843
Persistent or temporary Lobs returned from the database should be
48374844
closed with `lob.close()` unless they have been automatically closed.
@@ -4841,18 +4848,21 @@ Automatic closing of returned Lobs occurs when:
48414848
- a stream error occurs
48424849
- the Lob was used as the source for an IN OUT bind
48434850
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*.
48474853
48484854
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.
48564866
48574867
The `lob.close()` method emits the [Node.js Stream][16] 'close' event
48584868
unless the Lob has already been closed explicitly or automatically.

0 commit comments

Comments
 (0)