I made some significant changes to locking and deadlock detection in 3.2.2. If anybody has time, can you look over my changes? I get nervous about making major changes to maintenance releases like the 3.2 series, so any extra eyes debugging this would be much helpful. Thanks.

The EntityReentranceInterceptor now locks an EntityEnterpriseContext for the duration of the method call rather than just throwing an exception on reentrancy. The lock is actually a member variable of EntityEnterpriseContext and is implemented in server/src/main/org/jboss/ejb/plugins/lock/NonReentrantLock. I made this change so that NotSupported methods on Entity Beans would not throw an exception when concurrent access happens on these methods. An exception will still be thrown if The same transaction or thread tries to invoke on method one than once.

Since we're doing locking in yet another place, this additional lock also introduces another scenario in which deadlock can happen. This is even worse because there is no transaction timeout that will interrupt the blocked threads. So, what I've done is abstracted out deadlock detection into its own classes under:

common/src/main/org/jboss/util/deadlock

DeadlockDetector.java
Resource.java

All locks now implement the Resource interface. The Resource interface has one method:

getResourceHolder. The DeadlockDetector keeps a global graph of waiting resources so that it can be traversed to detect deadlock.

The Reentrant locks(NonReentrantLock) for method locking in the EntityReentranceInterceptor returns a Thread object if the lock was required outside a transaction context, or it returns a Transaction if the lock was required within a transaction context.

Now that we have this DeadlockDetector, we can expand deadlock detection to other locks that are beyond the scope of Entity beans.


-- ================ Bill Burke Chief Architect JBoss Group LLC. ================



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to