/** * releaseMethodLock * * if we reach the count of zero it means the instance is free from threads (and reentrency) * we wake up the next thread in the currentLock */ public void endInvocation(Invocation mi) { // Do we own the lock? Transaction tx = mi.getTransaction(); if (tx != null && tx.equals(getTransaction())) { // If there is no context or synchronization, release the lock EntityEnterpriseContext ctx = (EntityEnterpriseContext) mi.getEnterpriseContext(); if (ctx == null || ctx.hasTxSynchronization() == false) endTransaction(tx); } }
if(!ctx.hasTxSynchronization()) ctx.hasTxSynchronization(true); ctx.hasTxSynchronization(false); ctx.setTransaction(null); ctx.setTxAssociation(GlobalTxEntityMap.NONE); ctx.hasTxSynchronization(false); ctx.setTxAssociation(GlobalTxEntityMap.NONE); if(t instanceof RuntimeException)
protected void unableToPassivateDueToCtxLock(EnterpriseContext ctx, boolean passivateAfterCommit) { EntityEnterpriseContext ectx = (EntityEnterpriseContext)ctx; ectx.setPassivateAfterCommit(passivateAfterCommit); ConfigurationMetaData config = m_container.getBeanMetaData().getContainerConfiguration(); if(!config.isStoreNotFlushed() && ectx.hasTxSynchronization()) { ectx.setTxAssociation(GlobalTxEntityMap.PREVENT_SYNC); } }
SecurityActions.setContextClassLoader(container.getClassLoader()); container.pushENC(); ctx.hasTxSynchronization(false); ctx.setTransaction(null); try
if (tx.equals(ctxTx) && ctx.hasTxSynchronization() == false) ctx.setTransaction(null); !ctx.hasTxSynchronization() && discardContext)
ctx.hasTxSynchronization(false); ctx.setTxAssociation(GlobalTxEntityMap.NONE); ctx.setTransaction(null);
if(isReadOnly && ctx.hasTxSynchronization() == false)