Home All Groups Group Topic Archive Search About

How to Determine if a Record is Locked

Author
10 Jul 2006 10:48 PM
Scott
All,

I have set a transaction lock on an Sql Server 2005 database as below:
    transaction = connection.BeginTransaction(IsolationLevel.RepeatableRead);

I keep the connection and transaction open while processing data (done
deliberately).

When I launch another application I can read the record that is locked but
cannot update the record (which is desired).

However the only way I know it is locked is by throwing an exception on the
write to the record (also had to wait for the timeout to occur).

Is there a way using ADO.NET to query if that record is locked?

Thanks in advance.

AddThis Social Bookmark Button