User: fleury
Date: 00/10/02 19:34:53
Modified: src/main/org/jboss/ejb EnterpriseContext.java
Log:
reentrancy is not the only criteria for going in.
Some calls need to happen on different threads (not reentrant) so we just lock on
the context and wait.
In clear this removes the Exception on "reentrant" which is not correct for Entities
Revision Changes Path
1.15 +16 -14 jboss/src/main/org/jboss/ejb/EnterpriseContext.java
Index: EnterpriseContext.java
===================================================================
RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/ejb/EnterpriseContext.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- EnterpriseContext.java 2000/09/30 00:59:39 1.14
+++ EnterpriseContext.java 2000/10/03 02:34:53 1.15
@@ -36,7 +36,7 @@
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
- * @version $Revision: 1.14 $
+ * @version $Revision: 1.15 $
*/
public abstract class EnterpriseContext
{
@@ -108,27 +108,29 @@
public synchronized void lock()
{
locked ++;
-
- //new Exception().printStackTrace();
-
+
+ //new Exception().printStackTrace();
+
//DEBUG Logger.debug("EnterpriseContext.lock() "+hashCode()+"
"+locked);
+ Logger.debug("EnterpriseContext.lock() "+hashCode()+" "+locked);
}
public void unlock() {
// release a lock
locked --;
-
- //new Exception().printStackTrace();
- if (locked <0) new Exception().printStackTrace();
-
+
+ //new Exception().printStackTrace();
+ if (locked <0) new Exception().printStackTrace();
+
//DEBUG Logger.debug("EnterpriseContext.unlock() "+hashCode()+"
"+locked);
+ Logger.debug("EnterpriseContext.unlock() "+hashCode()+" "+locked);
}
public boolean isLocked() {
//DEBUG Logger.debug("EnterpriseContext.isLocked() "+hashCode()+" at
"+locked);
-
+ Logger.debug("EnterpriseContext.isLocked() "+hashCode()+" at "+locked);
return locked != 0;
}
@@ -140,13 +142,13 @@
public void clear() {
this.id = null;
- this.locked = 0;
- this.principal = null;
- this.synch = null;
- this.transaction = null;
+ this.locked = 0;
+ this.principal = null;
+ this.synch = null;
+ this.transaction = null;
}
-
+
// Package protected ---------------------------------------------