We have production code running for some time now. Yesterday, we suddenly received the following error:
2008-05-19 09:17:03,901 ERROR [org.hibernate.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
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:475)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
at org.hibernate.loader.Loader.scroll(Loader.java:2285)
at org.hibernate.loader.criteria.CriteriaLoader.scroll(CriteriaLoader.java:89)
at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1533)
at org.hibernate.impl.CriteriaImpl.scroll(CriteriaImpl.java:297)
We use a slight modified version of paginationCode (
http://www.hibernate.org/248.html) with Criteria instead of query
The issue went away after we restarted Tomcat (5.0.28).
Using Hibernate version: 3.2.6ga with the following properties:
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="org.hibernate.cache.CacheProvider">
net.sf.ehcache.hibernate.EhCacheProvider
</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
<property name="current_session_context_class">thread</property>
<property name="bytecode.use_reflection_optimizer">true</property>
Because this rarely happens and we aren't unable to recreate the problem, we would like community feedback on what to watch out for in preventing the problem from reappearing. Thanks.