Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

My database was running just fine this morning, up until it wasn't.

This query:

SELECT TOP (1) *
FROM tblTask;

comes back in no time at all, while this query:

SELECT *
FROM tblTask this_ with (updlock, rowlock);

which is generated by NHibernate in my app, is timing out in my software. In SSMS, I killed the query after letting it run for 9 minutes. The table has a total of 6 records.

The problem started coming up after the virtual machine that hosts the software running this query was rebooted this morning. Given the locking hint, I would have guessed that there was somehow a stray lock stuck on that table. I restarted the database, and also rebooted the server itself, but I still get the same behavior.

This table is only hit by a Windows service - nothing else should be locking the table and preventing access to it. The web site (which uses the rest of the database but not this table) appears to be running perfectly fine.

I'm not sure where to go from here. Any help?

share|improve this question
    
Presumably it's a blocking issue. Find out what's blocking the process. Does more than one instance of the Windows service hit the table at the same time? –  Jon Seigel Dec 21 '12 at 17:41
1  
Grab a copy of sp_whoisactive and see what query(ies) you're fighting against? –  billinkc Dec 21 '12 at 17:43
    
@JonSeigel Yes, I've been assuming a blocking issue as well; a little stumped cause nothing has changed, except for server patches. –  Remi Despres-Smyth Dec 22 '12 at 1:46
    
@billinkc Thanks, I wasn't aware of that. I'll try it tomorrow. –  Remi Despres-Smyth Dec 22 '12 at 1:47
add comment

1 Answer 1

up vote 1 down vote accepted

Based upon my investigation with sp_whoisactive (thanks @billinkc), it was a blocking issue with the Windows service accessing the table. I found the issue in code and corrected it.

What is still unclear to me is why this was not an issue prior to the server reboot, why it suddenly started coming up.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.