|
We had solved this problem before in 2.1.3 (rather inelegantly) and are in the process of retrofitting Gavin's 3.0 changes to 2.1.6. Our plans are to:
* add ScrollMode class to 2.1.6 from 3.0alpha * add [get|set]ScrollMode to QueryTranslator to 2.1.6 from 3.0alpha * amend Loader.prepareQueryStatement to set it's scrollable flag appropriately in the same way as 3.0alpha code does * amend Query and QueryImpl to expose a scroll(ScrollMode) method and apply 3.0alpha changes to these We can post the patch here within a day or two. Does anyone have any comments on this approach? I've made and tested a scroll patch for 2.1.6. Please, open this issue so that I could download the file.
cheers. Djail Here is the patch for Hibernate 2.1.6 to set scroll mode (based on Hibernate 3).
Thanks, I applied the patch file.
CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/impl BatcherImpl.java,1.18,1.19 QueryImpl.java,1.23,1.24 SQLQueryImpl.java,1.5,1.6 ScheduledIdentityInsertion.java,1.6,1.7 ScrollableResultsImpl.java,1.19,1.20 appied CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/engine Batcher.java,1.10,1.11 QueryParameters.java,1.6,1.7 appied CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/hql QueryTranslator.java,1.49,1.50 appied CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/loader Loader.java,1.49,1.50 appied CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/persister AbstractEntityPersister.java,1.50,1.51 appied CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate ScrollMode.java,NONE,1.1 Query.java,1.17,1.18 appied |
|||||||||||||||||||||||||||||||||||||||||||||||||
I will add support for
ScrollableResults sr = session.createQuery(...).scroll(FORWARD_ONLY);