Bugs item #634286, was opened at 2002-11-06 17:43
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=634286&group_id=22866

Category: JBossServer
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Ole Husgaard (sparre)
Assigned to: Bill Burke (patriot1burke)
Summary: Bug in the transactional locking code

Initial Comment:
I discovered this using Branch_3_2, but I think this
bug is present in all branches.

With multiple clients using UserTransaction, and the
queued pessimistic locking strategy, I see the
following problem in the locking code:

Client1: ut.begin()
  This calls the server, and returns the TPC for tx1
  to the client.

Client1: obj.invoke()
  This invokes a non-readonly method on an entity bean.
  In the server thread1 is selected for doing the work.
  In the bean lock, the holding transaction is set to
  tx1, and the holding thread is set to thread1.
  After doing the invocation, thread1 is put back into
  the RMI thread pool.
Client2: ut.begin()
  This calls the server, and returns the TPC for tx2
  to the client.
Client2: obj.invoke()
  This invokes the same bean as Client1 just invoked.
  In the server thread1 is selected (reused from the
  RMI pool) for doing the work.
  When invoking the locking code, thread1 should wait
  until the transaction tx1 started by Client1 is
  committed.
  However, that does not happen.
  In
org.jboss.ejb.plugins.lock.BeanLockSupport.deadlockDetection(),
  it is detected that the calling thread equals the
  holding thread, and an ApplicationDeadlockException
  is thrown.

I'm not sure that I completely understand this locking
code, so I'd rather not fix this myself.

However, it looks to me like the
BeanLockSupport.holdingThread instance variable
should be cleared before the transaction is committed.
But simply clearing holdingThread in the
endInvocation() method may cause problems with
reentrant calls.

Best Regards,

Ole Husgaard.



----------------------------------------------------------------------

Comment By: Brian Bannister (beoch)
Date: 2002-11-19 13:11

Message:
Logged In: YES 
user_id=651952

I'm seeing a lot of application deadlocks with my code,
though this may well be due to the dodgy hacks I've put in
to reduce the number of transactions -> speed up the server.

Any news on when this might be fixed and we can start
testing, or is it worth me taking a look at the code myself?

Cheers

Brian

----------------------------------------------------------------------

Comment By: Joe Simone (jsimone)
Date: 2002-11-08 10:32

Message:
Logged In: YES 
user_id=586242

Bill,

I am in dead-lock hell right now with JBoss 3.0.4.  Is there 
anyway I can get patch for 3.0.4 for this.

Thanks,
joe

----------------------------------------------------------------------

Comment By: Ole Husgaard (sparre)
Date: 2002-11-07 03:22

Message:
Logged In: YES 
user_id=175257

This doesn't hold me up. I currently do not have reentrant
beans, so I simply hacked the source to clear holdingThread
in endInvocation().

----------------------------------------------------------------------

Comment By: Bill Burke (patriot1burke)
Date: 2002-11-07 01:17

Message:
Logged In: YES 
user_id=176497

Good catch.  It's definately a bug.  HOlding you up?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=634286&group_id=22866


-------------------------------------------------------
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/rd524.html
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to