"SQLException: Result set already closed" in afterRollback() Method (Doc ID 1053792.1)

Last updated on JUNE 30, 2017

Applies to:

Oracle JDeveloper - Version 11.1.1.2.0 and later
Information in this document applies to any platform.

Symptoms

You are developing an ADF BC application in JDeveloper 11.1.1.1.0
You're deploying to WebLogic 10.3.1 and use an Oracle 10g database 10.2.0.4.
You are not using XA Datasources.

You implemented a solution to retain the selected records over commits and rollbacks, as explained by Steve Muench in example 68.

Sometimes a java.sql.SQLException with the message "Result set already closed" occurs in the afterRollback() method that you implemented in your custom ViewObjectImpl class.
The exception occurs in the call to executeQuery().

The stack trace is the following:

java.sql.SQLException: Result set already closed
        at weblogic.jdbc.wrapper.ResultSet.checkResultSet(ResultSet.java:110)
        at weblogic.jdbc.wrapper.ResultSet.preInvocationHandler(ResultSet.java:65)
        at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.getBytes(Unknown Source)
        at oracle.jbo.domain.Number$1facClass.createDatum(Number.java:107)
        at oracle.jbo.server.OracleSQLBuilderImpl.doLoadFromResultSet(OracleSQLBuilderImpl.java:1306)
        ...
        at <yourPackage>.<yourViewObjectImpl>.afterRollback(<yourViewObjectImpl>.java:<line>)
at oracle.jbo.server.DBTransactionImpl.rollback(DBTransactionImpl.java:2419)
...


You can surround the code by a try-catch block to prevent the error to be shown to the end user.
However, the user still notices that his selection is lost over the rollback.

NB: The problem was also discussed in the OTN forum: Result set already closed

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms