-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Scrolling with "Microsoft SqlServer" server side cursors
PostPosted: Thu Jan 23, 2014 5:54 am 
Newbie

Joined: Thu Jan 23, 2014 5:06 am
Posts: 1
Hi,

How to force hibernate to use a server side cursor when scrolling with the query.scroll(...) feature and Microsoft SqlServer.

The documentation http://technet.microsoft.com/en-us/library/ms378405.aspx explains perfectly what I need.

I have to use the result set type TYPE_SS_SERVER_CURSOR_FORWARD_ONLY and not the TYPE_FORWARD_ONLY which loads all rows in memory.

If I understand, the solution is the ScrollMode.FORWARD_ONLY with the option 'selectMethod=cursor' with the ms sqlserver driver and the 'useCursors=true' with the jTDS driver.

But the only solution I found is to modify the jdbc url, but this option will be applied to all queries.
So, how to force this feature only when I need it ?

An other solution is to use ScrollMode.SCROLL_SENSITIVE but the result set will be fully scrollable, updatable and sensitive to changes.
For best performances and isolation, I think it's not the best choice for my need.

Thanks in advance.

Stéphane


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.