Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 SQL Update times out after 15,000 records

Author  Topic 

sqlfan2

26 Posts

Posted - 2008-01-29 : 16:53:10
I have an interesting problem where I call 2 stored procs from .NET code in a tight loop. The first is to retrieve the next record to work on and the second is to update that record with the results.

After a while, the update proc times out and the update is not performed. I then terminate the loop because the record didn't update.

If I try and restart the .NET loop to process that record again it will just time out.

Now the update is simple, just modifies 2 columns. It works for about 15,000 rows and then comes up with this problem.

Now to fix it, all I have to do is update any field in the "errant" record from another tool (like SSMS or LinkPad) and then run the .net program again and this time the record updates instantaneously and processing continues.

Any ideas why a record can get "stuck" in a non-updateable state from .NET and then become "unstuck" after being touched by another tool?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-01-29 : 17:02:56
probably because of some kind of locking... try running profiler to see what is going on exactly.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out
Go to Top of Page

sqlfan2

26 Posts

Posted - 2008-01-29 : 18:51:22
I've never used profiler before so I've just run it but not sure what I'm looking for...

What kind of locking do you suspect being the problem? i.e. How would I run the profiler against that DB to find the lock?

Thanks for your help.
Go to Top of Page
   

- Advertisement -