Hi,
I have a Spring Batch job, which uses HibernateCursorItemReader for reading some items from SQL Server 2008 database. The job has worked fine in unit & integration tests and in test environment. After I included the job as a part of larger Batch process group as a last job in the group queue, it gives me an exception:
If I boot my Tomcat and run the job again, everything works fine. So it seems, that in some cases Hibernate session, or perhaps a transaction gets stuck somehow? Any idea of this?Code:2011-02-01 06:36:20 ERROR AssertionFailure.java:22 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.hql.QueryLoader.scroll(QueryLoader.java:441) at org.hibernate.hql.ast.QueryTranslatorImpl.scroll(QueryTranslatorImpl.java:390) at org.hibernate.engine.query.HQLQueryPlan.performScroll(HQLQueryPlan.java:245) at org.hibernate.impl.StatelessSessionImpl.scroll(StatelessSessionImpl.java:586) at org.hibernate.impl.QueryImpl.scroll(QueryImpl.java:67) at org.springframework.batch.item.database.HibernateItemReaderHelper.getForwardOnlyCursor(HibernateItemReaderHelper.java:126) at org.springframework.batch.item.database.HibernateCursorItemReader.doOpen(HibernateCursorItemReader.java:183) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:134)
I am using Spring Batch 2.1.5.RELEASE and Hibernate 3.2.0.cr4.


Reply With Quote
