run the following in a sql server session
CREATE DATABASE locktest
GO
CREATE TABLE locktest.dbo.lock_this_table (id INT)
BEGIN TRAN
EXEC locktest..sp_getapplock @Resource = 'lock_this_table',@LockMode = 'Exclusive'
In a separate window, execute the following code, I would expect it to hang whilst the first transaction remains open, any idea why it doesn't?
SELECT * FROM locktest.dbo.lock_this_table
Aucun commentaire:
Enregistrer un commentaire