-->
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.  [ 2 posts ] 
Author Message
 Post subject: ScrollableResultSets Causes MSSQL ASYNC_NETWORK_IO Lock
PostPosted: Sun Jun 26, 2011 11:48 am 
Newbie

Joined: Fri Nov 20, 2009 2:39 pm
Posts: 4
We are using ScrollableResultSets to read through a large number of rows and, after some processing, update each row after it is read. This pattern works perfectly for us, and has worked with some extremely large data sets (1,000,000+ rows). We're using MS SQL Server 2008 R2 with the most recent MS JDBC Driver.

However, we are now running into a problem. In one program, this pattern works for up to about 400 or so rows. Anything larger than that, and we get a SQL Server lock. The SELECT statement puts a ASYNC_NETWORK_IO lock on the table, and this causes the update to lock and causes all sorts of issues. For this one specific table and process, it is absolutely consistent. We always get the ASYNC_NETWORK_IO lock on the table at 450+ rows. Any number of rows less than that, it works perfectly. Any other table or use of the identical pattern, it works perfectly.

Has anybody every experienced anything like this before?


Top
 Profile  
 
 Post subject: Re: ScrollableResultSets Causes MSSQL ASYNC_NETWORK_IO Lock
PostPosted: Mon Jun 27, 2011 9:59 am 
Newbie

Joined: Fri Nov 20, 2009 2:39 pm
Posts: 4
I am replying to my own post, but I resolved this issue, and want to have this out here in case anyone else has the same issue!

The problem is the JDBC Driver setting; if you are using ScrollableResultSets you MUST make sure that selectMethod is set to "cursor" and not "direct" (which is the default). If you do have it set as "direct" then SQL pulls the dataset back to the driver and will not use server-cursors.


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

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.