By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,062 Members | 1,374 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,062 IT Pros & Developers. It's quick & easy.

How to debug deadlock detected in logs files?

P: 1
I have a deadlock detected in my postgres log file. My application is getting into such situation in every 4-5 days. Below is the log message:
Expand|Select|Wrap|Line Numbers
  1. Process 21865 waits for ShareLock on transaction 9981406; blocked by process 24027.
  2. Process 24027 waits for ExclusiveLock on tuple (1316,26) of relation 16631 of database 16393; blocked by process 21865.
  3. Process 21865: update fs_item set version=$1, createdby=$2, lastupdateddate=$3, updatedby=$4, receiptdate=$5, receivedby=$6, credit_amount=$7, credit_currency=$8, credit_systemamount=$9, credit_systemcurrency=$10, credit_exchangerate=$11, ercreceiptdate=$12, ercreceivedby=$13 where itemid=$14 and version=$15
  4. Process 24027: update fs_item set version=$1, createdby=$2, lastupdateddate=$3, updatedby=$4, receiptdate=$5, receivedby=$6, credit_amount=$7, credit_currency=$8, credit_systemamount=$9, credit_systemcurrency=$10, credit_exchangerate=$11, ercreceiptdate=$12, ercreceivedby=$13 where itemid=$14 and version=$15
Is there any why by which i can debug this issue?

Please let me know if there is any clue to the same. We are using Hibernate + ehcahe + Postgres in our application.

Thanks & Regards,
Jan 19 '11 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 700
It looks that two processes 21865 and 24027 execute the same update statement without commiting it. Probably there is some unique key or primary key on that table.
Maybe you have to commit every DML query after executing it.
Jan 23 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.