User: patriot1burke
Date: 02/04/09 22:40:12
Modified: src/main/org/jboss/ejb/plugins
EntitySynchronizationInterceptor.java
Log:
read-only methods and read-only beans no longer synchronize with the transaction.
Revision Changes Path
1.64 +11 -9
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.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- EntitySynchronizationInterceptor.java 5 Apr 2002 04:08:02 -0000 1.63
+++ EntitySynchronizationInterceptor.java 10 Apr 2002 05:40:12 -0000 1.64
@@ -43,7 +43,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.63 $
+ * @version $Revision: 1.64 $
*
* <p><b>Revisions:</b><br>
* <p><b>2001/06/28: marcf</b>
@@ -243,7 +243,7 @@
{
lock.schedule(mi);
register(ctx, tx); // Set tx
- lock.releaseMethodLock();
+ lock.endInvocation(mi);
}
finally
{
@@ -284,7 +284,11 @@
}
catch (Exception ex)
{
- clearContextTx("loadEntity Exception", ctx, tx, log.isTraceEnabled());
+ // readonly does not synchronize, lock or belong with transaction.
+ if (!container.isReadOnly() &&
!container.getBeanMetaData().isMethodReadOnly(mi.getMethod().getName()))
+ {
+ clearContextTx("loadEntity Exception", ctx, tx,
log.isTraceEnabled());
+ }
throw ex;
}
@@ -298,17 +302,15 @@
// Invocation with a running Transaction
if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION)
{
- try
- {
- //Invoke down the chain
- return getNext().invoke(mi);
- }
- finally
+ // readonly does not synchronize, lock or belong with transaction.
+ if (!container.isReadOnly() &&
!container.getBeanMetaData().isMethodReadOnly(mi.getMethod().getName()))
{
//register the wrapper with the transaction monitor (but only register
once).
// The transaction demarcation will trigger the storage operations
register(ctx,tx);
}
+ //Invoke down the chain
+ return getNext().invoke(mi);
}
//
else
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development