db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naveen Murthy" <naveen.sriniv...@aricent.com>
Subject RE: Deadlock error
Date Fri, 18 Apr 2008 17:33:38 GMT
Raj;

the deadlock error is initially wrapped in sqlexception.
this is probably a contention for db resource as a part of
the underlying db transaction. it may not have anything to
do with torque.

u may have to investigate ur usecases to see if such scenarios
arise.

typical scenario will be, tran 1 is waiting for exclusive lock
on table B, while at same time not releasing lock on table A
tran 2 is doing viceversa and u have a deadlock. Depending on
the rules set at the db, one will succeed and other wud fail
with error to the user.

few yrs ago, we were working for a client who ran a version
of sybase that did not support row level locking. it only
supported Page level locking. So even tho there was no contention
for a single row, if unfortunately some other row was in the same
page, that got involved in another transaction, we intermittently
got deadlocks. after lotta debuging we fnally solved the issue
by setting max_rows_per_page to 1 for the concerned tables.

thx,
Naveen

-----Original Message-----
From: Raj [mailto:nwiraj@yahoo.com]
Sent: Fri 4/18/2008 1:17 PM
To: Apache Torque Users List
Subject: Deadlock error
 
All,

Getting a deadlock related error intermittently.
The stack trace is as shown below.

Torque version: 3.2
Mysql version: mysql  Ver 14.12 Distrib 5.0.33, for
apple-darwin8.8.4 (i686) using  EditLine wrapper

Any hints?

Thanks,
Raj


org.apache.torque.TorqueException:
java.sql.SQLException: Deadlock found when trying to
get lock; Try restarting transaction message from
server: "Lock wait timeout exceeded; try restarting
transaction"
        at
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:103)
        at
org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:639)
        at
org.apache.torque.util.BasePeer.access$000(BasePeer.java:73)
        at
org.apache.torque.util.BasePeer$IOUProcessCallback.process(BasePeer.java:1254)
        at
org.apache.torque.util.BasePeer.processTables(BasePeer.java:1645)
        at
org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1234)



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org






Mime
View raw message