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?