Red Hat 7.2
JDK 1.4.1-b21
jboss-head from ~2pm EST 10/29/2002

Scenario:

Session bean which gets some data from some EntityBeans.  Session bean is
tied to a client GUI in which the user can 'click' a button and the client
calls a method on the Session bean to retrieve some data.

Problem:

We are getting intermittent ApplicationDeadlockExceptions.  Particularly,
the "Application deadlock detected: Current thread already has tx lock in
different transaction.".

Possible Cause?:

>From initial analysis, I think it has something to do with
BeanLockSupport.deadlockDetection(Transaction miTx).  The first test in
deadlockDetection() is to see if
Thread.currentThread().equals(holdingThread).  If they are equal, you get
the exception.  Well, the code that it is being thrown on is just a CMP
field of an entity bean.  That code does not cause any re-entrance.

The only thing I can think of is that the same RMI worker thread happened to
receive two user 'clicks' in rapid succession, thus causing
deadlockDetection to see the same thread trying to get the lock on the
EntityBean.

This theory is only possible if QueuedPessimisticEJBLock.endTransaction()
doesn't get called before the Session bean returns from the first call.
When QueuedPessimisticEJBLock.endTransaction() is called, it nulls out the
holdingThread and therefore this particular exception can never occur.

Does this theory make sense?

Thanks,
Michael


-------------------------------------------------------
This sf.net email is sponsored by: 
To learn the basics of securing your web site with SSL, 
click here to get a FREE TRIAL of a Thawte Server Certificate: 
http://www.gothawte.com/rd522.html
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to