The holdable cursor feature permits an application to keep cursors open after implicit or explicit commits. By default, the cursors are held open after a commit. Starting with Java 2 Platform, Standard Edition, v 1.4 (J2SE), cursors can be created with close when a commit occurs option. Such cursors will be automatically closed when a commit happens. Cursors are automatically closed when a transaction aborts, whether or not they have been specified to be held open.
To specify whether a cursor should be held open after a commit takes place, supply one of the following ResultSet parameters to the Connection method createStatement, prepareStatement, or prepareCall:
Cursors are closed when an implicit or explicit commit is performed.
Cursors are held open when a commit is performed, implicitly or explicitly. This is the default behavior.
The method Statement.getResultSetHoldability() indicates whether a cursor generated by the Statement object stays open or closes, upon commit. See the Derby Reference Manual for more information.
When an implicit or explicit commit occurs, ResultSets that hold cursors open behave as follows:
When a rollback occurs either explicitly or implicitly, the following behavior applies: