Getting Hibernate scrollable result set exception after Hibernate recovers when database is restarted
Issue
We are using JBoss 5.0.1 connected to an Oracle 11g database server. We are using the version of Hibernate that ships with 5.0.1. We are using JDK 1.6 with the latest Oracle drivers.
Our deployment uses a datasource for its Hibernate connection to the database. The following is a sample of the datasource configuration.
<datasources>
<local-tx-datasource>
<jndi-name>Default</jndi-name>
<connection-url>jdbc:oracle:thin:@localhost:1521:slemr95</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<security-domain>Default.Datasource.SecurityDomain</security-domain>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
</local-tx-datasource>
</datasources>
Our problem concerns having JBoss start before the database has started. The deployment successfully bootstraps Hibernate and will receive “unable to connect to database” exceptions until the database is running. Once the database is running Hibernate is able to recover and we are able to perform CRUD operations. The deployment is not able to use a scrollable result set, an exception is thrown with the following information.
[AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: scrollable result sets are not enabled
The deployment can use a scrollable result set once JBoss is restarted (and the database is running). Is this a know issue with Hibernate? Is there a work around for this problem?
Environment
JBoss Enterprise Application Platform (EAP) 5.0.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
