User: mnf999
Date: 01/08/02 09:29:02
Modified: src/main/org/jboss/ejb/plugins EntityLockInterceptor.java
EntitySynchronizationInterceptor.java
Log:
A simpler lock mechanism
Revision Changes Path
1.2 +1 -0 jboss/src/main/org/jboss/ejb/plugins/EntityLockInterceptor.java
Index: EntityLockInterceptor.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityLockInterceptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EntityLockInterceptor.java 2001/08/01 19:03:27 1.1
+++ EntityLockInterceptor.java 2001/08/02 16:29:01 1.2
@@ -56,7 +56,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Bill Burke</a>
-* @version $Revision: 1.1 $
+* @version $Revision: 1.2 $
*
* <p><b>Revisions:</b><br>
* <p><b>2001/07/30: marcf</b>
@@ -136,6 +136,7 @@
* as well as the default serialization required by the
specification
* the method releases the sync if the thread isn't
scheduled and goes to wait
* upon waking up it must go through the schedule again
+ * Also schedule must add a methodLock
*/
threadIsScheduled = lock.schedule(mi);
}
1.43 +7 -15
jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java
Index: EntitySynchronizationInterceptor.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- EntitySynchronizationInterceptor.java 2001/08/01 18:34:39 1.42
+++ EntitySynchronizationInterceptor.java 2001/08/02 16:29:01 1.43
@@ -57,7 +57,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Bill Burke</a>
- * @version $Revision: 1.42 $
+ * @version $Revision: 1.43 $
*
* <p><b>Revisions:</b><br>
* <p><b>2001/06/28: marcf</b>
@@ -243,6 +243,7 @@
// Store entity
if (dirty)
{
+ System.out.println("storing");
container.getPersistenceManager().storeEntity(ctx);
}
}
@@ -295,7 +296,7 @@
if( log.isTraceEnabled() )
log.trace("invoke called for ctx "+ctx+", tx="+tx);
- //Commit Option D....
+ //Commit Option D....
if(commitOption == ConfigurationMetaData.D_COMMIT_OPTION &&
!validContexts.contains(ctx.getId()))
{
//bean isn't in cache
@@ -308,6 +309,7 @@
{
try
{
+ System.out.println("Loading");
// If not tell the persistence manager to load the state
container.getPersistenceManager().loadEntity(ctx);
}
@@ -440,7 +442,7 @@
if( trace )
log.trace("sync calling store on ctx "+ctx+",
dirty="+dirty);
- if (dirty)
+ if (dirty)
container.getPersistenceManager().storeEntity(ctx);
}
}
@@ -542,11 +544,7 @@
ctx.setTransaction(null);
- // notify the lock of the end of the transaction
- // it wakes up all the threads in the current transaction
- // it wakes up at least one thread from the next transaction
- // This next tx thread will set the transaction variable in the lock
logic
- lock.nextTransaction();
+ lock.setTransaction(null);
if( trace )
log.trace("afterCompletion, sent notifyAll on TxLock for
ctx="+ctx);
@@ -573,13 +571,7 @@
// The context is no longer synchronized on the TX
ctx.hasTxSynchronization(false);
ctx.setTransaction(null);
-
-
- // notify the lock this will set current transaction to null
- // it also wakes up at least one thread from the next transaction
- // This thread will set the next transaction in the lock logic
- lock.nextTransaction();
-
+ lock.setTransaction(null);
}
finally
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development