History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: HB-1181
Type: Patch Patch
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Gavin King
Reporter: Nate Boyd
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hibernate2

Allow forward-only result set scrolling

Created: 17/Aug/04 04:40 PM   Updated: 09/Jan/05 09:16 PM
Component/s: core
Affects Version/s: 2.1.6
Fix Version/s: 3.0 beta 1, 2.1.8

Time Tracking:
Not Specified

File Attachments: 1. Text File setScrollMode.patch (14 kb)

Environment: Hibernate 2.1.6 on Oracle 9.2.0.4


 Description  « Hide
The current implementation of scroll() uses a prepared statement with ResultSet.TYPE_SCROLL_INSENSITIVE. Oracle 9i's JDBC driver caches scrollable results sets in the JVM, meaning that scroll() is impractical for large result sets:

http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/resltset.htm#1017914

I suggest allowing forward-only result set scrolling with a new Query.scroll(boolean) method, allowing the user to specify whether the result set should be forward-only rather than scroll-insensitive.

Additional refactoring of the ScrollableResults interface would be required since it would not be possible to "retreat" when scrolling through a forward-only result set.


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Gavin King - 17/Aug/04 05:47 PM
I wondered how long before someone requested this ;-)

I will add support for

ScrollableResults sr = session.createQuery(...).scroll(FORWARD_ONLY);

Gavin King - 17/Aug/04 08:13 PM
Done in 3.0alpha

Jerry Shea - 01/Sep/04 09:42 PM
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?

Gavin King - 01/Sep/04 09:51 PM
Sounds good!

Djail Turgumbaev - 03/Sep/04 02:09 AM
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

Djail Turgumbaev - 06/Sep/04 01:23 AM
Here is the patch for Hibernate 2.1.6 to set scroll mode (based on Hibernate 3).

Gavin King - 09/Jan/05 09:11 PM
Thanks, I applied the patch file.

CVS Notification Service - 09/Jan/05 09:16 PM
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 HB-1181 (backported ScrollMode)


CVS Notification Service - 09/Jan/05 09:16 PM
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 HB-1181 (backported ScrollMode)


CVS Notification Service - 09/Jan/05 09:16 PM
CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/hql QueryTranslator.java,1.49,1.50
appied HB-1181 (backported ScrollMode)


CVS Notification Service - 09/Jan/05 09:16 PM
CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/loader Loader.java,1.49,1.50
appied HB-1181 (backported ScrollMode)


CVS Notification Service - 09/Jan/05 09:16 PM
CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/persister AbstractEntityPersister.java,1.50,1.51
appied HB-1181 (backported ScrollMode)


CVS Notification Service - 09/Jan/05 09:16 PM
CVS COMMIT LOG:
SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate ScrollMode.java,NONE,1.1 Query.java,1.17,1.18
appied HB-1181 (backported ScrollMode)