Click here to Skip to main content
15,885,910 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have created Rowlock on a row/record of sql server for updating.

So that i will allow only one person to update a record at a time.

So when another user(2nd user)try's to read same record it is throwing "TimeOut out exception" instead of throwing exact exception(Needed row lock exception).

Please tell me how to handle row lock exception please.
Posted
Updated 1-Nov-11 5:07am
v2

1 solution

Transactions will wait until the lock has been lifted on the row or a connection time out is reached.

If you are getting timeouts then you are using your database badly and locking rows for extended periods greater than a few milliseconds. This is bad.

Transactions and locking should be as short as possible.
 
Share this answer
 
Comments
Espen Harlinn 1-Nov-11 13:25pm    
5'ed!
Mehdi Gholam 1-Nov-11 13:50pm    
Cheers
Member 7962316 1-Nov-11 14:07pm    
then please tell me how to solve this problem please.........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900