1

I'm using SQL 2000 for my application. My application is using N tables. My application has a wrapper for SQL server called Database server. It is running as a 24/7 windows service.

If I have checked the integrity check option in the SQL maintenance plan, when this task is running one time after that one of my tables has been locked and it has been never unlocked. So my history of the database transaction has been lost.

Please provide your suggestion how to solve this problem.

sth
  • 222,467
  • 53
  • 283
  • 367
NAGARAJAN
  • 21
  • 2
  • Is this a continuing problem, or is it a one-time lock that has never been released? The CHECK INTEGRITY maintenance plan step locks the database exclusively, which can cause contention issues. If you have SQL Server Enterprise, it can do operations like this while remaining online, but Standard is not as good at sharing. – SqlRyan Jul 24 '09 at 04:32

1 Answers1

1

What if you have a client-side command timeout? And the locks are your own locks as a result of the DBCC?

Your code will timeout waiting for the DBCC to finish, but any locks it's already issued are not rolled back.

A command timeout tells SQL Server to simply stop processing. To release locks you need to either ROLLACK on the connection or close the connection.

Options:

Community
  • 1
  • 1
gbn
  • 422,506
  • 82
  • 585
  • 676