SQL Server Rcrd Locks via IIS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Asp.net application that writes data to a SQL Server database. The
database has some stored procedures that are known to be poorly written which
can cause some records to become deadlocked. If I am running in debug mode
when this occurs, the code hangs and never returns. The records remain
deadlocked until the connection is broken (at least I think that is when it
frees).

What I would like to know is how to break that connection from my
development machine and local IIS server? Once the record is locked, I can
not free it until I reboot my computer. I've tried closing the development
environment and stopping IIS. Niether of those things work.

Can anyone make a suggestion of how I can break the lock without rebooting?
 
Hi Jerry,
Can anyone make a suggestion of how I can break the lock without rebooting?

You could try to set the database to single-user and back to multi-user
again:
ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE <dbname> SET SINGLE_USER;

Hope this helps,

Roland
 
Back
Top