Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dead Locks in Sql server 2000

Author  Topic 

bpuccha
Starting Member

34 Posts

Posted - 2013-07-05 : 10:33:01
Hi, I have a stored procedure which reads records from temp table and insert into request table, at the same time my java code tries to update different row in the same table,i am getting below error in my java code...

Transaction (Process ID 190) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

How to avoid these types of locks? is it posssible to lock the rows instead of table while insertion?

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-07-06 : 03:51:07
Deadlocks occur because at least two tasks are blocing each other permanently. there are a few different ways of getting the deadlock detail .Once you've identified the deadlock - analyse the transaction logic and make more efficient , read more on detecting deadlocks http://www.sqlserver-dba.com/2012/11/sql-server-how-to-detect-and-troubleshoot-blocking-and-deadlocks.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -