permaculture playing cards*
The moose likes JDBC and the fly likes ransaction (Process ID 52) was deadlocked on lock resources  + SQL Server 2005 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ransaction (Process ID 52) was deadlocked on lock resources  + SQL Server 2005" Watch "ransaction (Process ID 52) was deadlocked on lock resources  + SQL Server 2005" New topic
Author

ransaction (Process ID 52) was deadlocked on lock resources + SQL Server 2005

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 753
Hi i m getting below exception....

i have one process which update a table and at the same time another process is trying to update the same table at the same time..

I am using SQL server 2005 and for updating i am using Stored Procedure.



can anybody help me out solving this issue ???


Jigar Naik


Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Well deadlocks are expected behaviour now and again in a relational database, which is why databases have recovery mechanisms. If it happens all the time (in a repeatable way) you have an issue in your stored procedure which you will need to address. If it happens fequently in an unrepeatable way you possibly have an issue with your data model (typically a poorly normalized data model), or your transaction times may be too long. It it happens only very occasionally you can code round it - catch the SQLException, check the error code == deadlock and retry the database operation.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ransaction (Process ID 52) was deadlocked on lock resources + SQL Server 2005
 
Similar Threads
A lot of deadlocks using JDBC
org.hibernate.exception.LockAcquisitionException without any explicit lock
Deadlock problems with Hibernate/Spring/MS-SQL
error saving string fields larger than 2000 chars
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing.