/** * Reactivate transaction synchronization for the current thread * and resume all given synchronizations. * @param suspendedSynchronizations a List of TransactionSynchronization objects */ private void doResumeSynchronization(List<TransactionSynchronization> suspendedSynchronizations) { TransactionSynchronizationManager.initSynchronization(); for (TransactionSynchronization synchronization : suspendedSynchronizations) { synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } }
/** * Reactivate transaction synchronization for the current thread * and resume all given synchronizations. * @param suspendedSynchronizations a List of TransactionSynchronization objects */ private void doResumeSynchronization(List<TransactionSynchronization> suspendedSynchronizations) { TransactionSynchronizationManager.initSynchronization(); for (TransactionSynchronization synchronization : suspendedSynchronizations) { synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } }
/** * Reactivate transaction synchronization for the current thread * and resume all given synchronizations. * @param suspendedSynchronizations List of TransactionSynchronization objects */ private void doResumeSynchronization(List<TransactionSynchronization> suspendedSynchronizations) { TransactionSynchronizationManager.initSynchronization(); for (TransactionSynchronization synchronization : suspendedSynchronizations) { synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } }
/** * Reactivate transaction synchronization for the current thread * and resume all given synchronizations. * @param suspendedSynchronizations a List of TransactionSynchronization objects */ private void doResumeSynchronization(List<TransactionSynchronization> suspendedSynchronizations) { TransactionSynchronizationManager.initSynchronization(); for (TransactionSynchronization synchronization : suspendedSynchronizations) { synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } }
public void threadAssociated(Transaction transaction) { try { if (transaction.getStatus() == Status.STATUS_ACTIVE) { SuspendedResourcesHolder holder = suspendedResources.remove(transaction); if (holder != null && holder.getSuspendedSynchronizations() != null) { TransactionSynchronizationManager.setActualTransactionActive(true); TransactionSynchronizationManager.setCurrentTransactionReadOnly(holder.isReadOnly()); TransactionSynchronizationManager.setCurrentTransactionName(holder.getName()); TransactionSynchronizationManager.initSynchronization(); for (Iterator<?> it = holder.getSuspendedSynchronizations().iterator(); it.hasNext();) { TransactionSynchronization synchronization = (TransactionSynchronization) it.next(); synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } } } } catch (SystemException e) { return; } } public void threadUnassociated(Transaction transaction) {
public void threadAssociated(Transaction transaction) { try { if (transaction.getStatus() == Status.STATUS_ACTIVE) { SuspendedResourcesHolder holder = suspendedResources.remove(transaction); if (holder != null && holder.getSuspendedSynchronizations() != null) { TransactionSynchronizationManager.setActualTransactionActive(true); TransactionSynchronizationManager.setCurrentTransactionReadOnly(holder.isReadOnly()); TransactionSynchronizationManager.setCurrentTransactionName(holder.getName()); TransactionSynchronizationManager.initSynchronization(); for (Iterator<?> it = holder.getSuspendedSynchronizations().iterator(); it.hasNext();) { TransactionSynchronization synchronization = (TransactionSynchronization) it.next(); synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } } } } catch (SystemException e) { return; } } public void threadUnassociated(Transaction transaction) {
public void threadAssociated(Transaction transaction) { try { if (transaction.getStatus() == Status.STATUS_ACTIVE) { SuspendedResourcesHolder holder = suspendedResources.remove(transaction); if (holder != null && holder.getSuspendedSynchronizations() != null) { TransactionSynchronizationManager.setActualTransactionActive(true); TransactionSynchronizationManager.setCurrentTransactionReadOnly(holder.isReadOnly()); TransactionSynchronizationManager.setCurrentTransactionName(holder.getName()); TransactionSynchronizationManager.initSynchronization(); for (Iterator<?> it = holder.getSuspendedSynchronizations().iterator(); it.hasNext();) { TransactionSynchronization synchronization = (TransactionSynchronization) it.next(); synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } } } } catch (SystemException e) { return; } } public void threadUnassociated(Transaction transaction) {
public void threadAssociated(Transaction transaction) { try { if (transaction.getStatus() == Status.STATUS_ACTIVE) { SuspendedResourcesHolder holder = suspendedResources.remove(transaction); if (holder != null && holder.getSuspendedSynchronizations() != null) { TransactionSynchronizationManager.setActualTransactionActive(true); TransactionSynchronizationManager.setCurrentTransactionReadOnly(holder.isReadOnly()); TransactionSynchronizationManager.setCurrentTransactionName(holder.getName()); TransactionSynchronizationManager.initSynchronization(); for (Iterator<?> it = holder.getSuspendedSynchronizations().iterator(); it.hasNext();) { TransactionSynchronization synchronization = (TransactionSynchronization) it.next(); synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } } } } catch (SystemException e) { return; } } public void threadUnassociated(Transaction transaction) {
/** * Resume the given transaction. Delegates to the <code>doResume</code> * template method first, then resuming transaction synchronization. * @param transaction the current transaction object * @param resourcesHolder the object that holds suspended resources, * as returned by suspend * @see #doResume * @see #suspend */ private void resume(Object transaction, SuspendedResourcesHolder resourcesHolder) throws TransactionException { if (resourcesHolder.getSuspendedSynchronizations() != null) { TransactionSynchronizationManager.setActualTransactionActive(true); TransactionSynchronizationManager.setCurrentTransactionReadOnly(resourcesHolder.isReadOnly()); TransactionSynchronizationManager.setCurrentTransactionName(resourcesHolder.getName()); TransactionSynchronizationManager.initSynchronization(); for (Iterator it = resourcesHolder.getSuspendedSynchronizations().iterator(); it.hasNext();) { TransactionSynchronization synchronization = (TransactionSynchronization) it.next(); synchronization.resume(); TransactionSynchronizationManager.registerSynchronization(synchronization); } } doResume(transaction, resourcesHolder.getSuspendedResources()); }