You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "McCarrier, Alex" <am...@pointserve.com> on 2004/12/07 20:28:00 UTC

RE: Transaction deadlocks -- update

So what I thought was transaction related seems to be related to
something else... I'm still getting these deadlocks even when I manually
control the transactions.  It's just that by manually controlling the
transaction, I stopped getting the deadlock on one particular test, but
now other tests are deadlocking when they are inside a transaction.

-----Original Message-----
From: McCarrier, Alex [mailto:amccarrier@pointserve.com] 
Sent: Tuesday, December 07, 2004 11:02 AM
To: ibatis-user-java@incubator.apache.org
Subject: Transaction deadlocks


I'm running into the following scenario:

In my unit tests, when I'm testing basic CRUD functionality, on the
removal of an object that has an aggregate relationship with other
objects, I the JVM hangs indefinitely. 

This happens consistently when I have one object that contains a list of
other persistent objects.  When we remove the parent object, this
triggers a cascade delete on the contained objects.  After the final
removal of the parent objects, when the ibatis code calls the JDBC
PreparedStatement.execute method, the JVM never returns from that
method.

This seems to be somehow related to transactions.  If I specifically
demarcate the transaction using start/commit/end transaction whenever
I'm doing one of these cascade delete operations, it works fine.  If I
rely on the ibatis framework for doing automatic transactions, then I
get these deadlocks, but they only seem to show up in these cascade
delete scenarios.

One thing to note, is that my transaction manager is set to external,
however in these particular unit tests, there is nothing that sets the
transaction since these tests are not calling through an EJB (where we
normally have our transaction boundaries declared).  So this begs the
question, do automatic transactions only work when the
TransactionManager type is JDBC?

This is on iBatis 2.0.8, Oracle 9, and Jboss 3.2.1.