iterate() method requires the corresponding jdbc connection to be not in autoCommit mode. When JDBCTransaction is used, this transaction at begin switches off autoCommit. But the JTATransaction does do so. Then iterate() fetches IDs. And for each ID it fetches an entity. This entity fetch closes connection. Then when I am trying to fetch the next ID the connection is already closed and a corresponding ResultSet is closed too.
Stack trace:
Code:
org.firebirdsql.jdbc.FBSQLException: The result set is closed
at org.firebirdsql.jdbc.FBResultSet.checkCursorMove(FBResultSet.java:217)
at org.firebirdsql.jdbc.FBResultSet.next(FBResultSet.java:249)
at org.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:83)
at org.hibernate.impl.IteratorImpl.next(IteratorImpl.java:120)
Can we use iterate() in context of JTATransaction?