User: patriot1burke
Date: 01/08/06 09:27:01
Modified: src/main/org/jboss/ejb/plugins
EntitySynchronizationInterceptor.java
Log:
use getContainer().getTxEntitymap() instead of
getCotnainer().getApplication().getTxEntityMap()
Revision Changes Path
1.49 +6 -12
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.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- EntitySynchronizationInterceptor.java 2001/08/05 19:32:19 1.48
+++ EntitySynchronizationInterceptor.java 2001/08/06 16:27:01 1.49
@@ -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.48 $
+ * @version $Revision: 1.49 $
*
* <p><b>Revisions:</b><br>
* <p><b>2001/06/28: marcf</b>
@@ -186,20 +186,18 @@
try
{
ctxContainer = (EntityContainer) ctx.getContainer();
- // associate the entity bean with the transaction so that
- // we can do things like synchronizeEntitiesWithinTransaction
- ctxContainer.getApplication().getTxEntityMap().associate(tx, ctx);
-
// We want to be notified when the transaction commits
tx.registerSynchronization(synch);
+ // associate the entity bean with the transaction so that
+ // we can do things like synchronizeEntitiesWithinTransaction
+ // do this after registerSynchronization, just in case there was an
exception
+ ctxContainer.getTxEntityMap().associate(tx, ctx);
+
ctx.hasTxSynchronization(true);
}
catch (RollbackException e)
{
- //Indicates that the transaction is already marked for rollback
- ctxContainer.getApplication().getTxEntityMap().disassociate(tx, ctx);
-
// The state in the instance is to be discarded, we force a reload of state
synchronized (ctx)
{ctx.setValid(false);}
@@ -210,8 +208,6 @@
}
catch (Exception e)
{
- if( ctxContainer != null )
- ctxContainer.getApplication().getTxEntityMap().disassociate(tx, ctx);
// If anything goes wrong with the association remove the ctx-tx
association
clearContextTx("Exception", ctx, tx, trace);
throw new EJBException(e);
@@ -516,8 +512,6 @@
}
finally
{
- // finish the transaction association
- container.getApplication().getTxEntityMap().disassociate(tx, ctx);
if( trace )
log.trace("afterCompletion, clear tx for ctx="+ctx+", tx="+tx);
// The context is no longer synchronized on the TX
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development