void rollbackAndDissociate() throws IllegalStateException, SystemException { if (isImported()) { throw Log.log.rollbackOnImported(); } notifyAssociationListeners(false); try { owner.getProvider().getTransactionManager().rollback(); } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
/** * Outflow the given local transaction to the given location. The returned handle * must be used to confirm or forget the enlistment attempt either immediately or at some point in the future; * failure to do so may cause the transaction to be rolled back with an error. * * @param location the location to outflow to (must not be {@code null}) * @param transaction the transaction (must not be {@code null}) * @return the enlistment handle (not {@code null}) * @throws SystemException if the transaction manager fails for some reason * @throws RollbackException if the transaction has been rolled back in the meantime * @throws IllegalStateException if no transaction is active * @throws UnsupportedOperationException if the provider for the location does not support outflow */ public XAOutflowHandle outflowTransaction(final URI location, final LocalTransaction transaction) throws SystemException, IllegalStateException, UnsupportedOperationException, RollbackException { Assert.checkNotNullParam("location", location); Assert.checkNotNullParam("transaction", transaction); XAOutflowedResources outflowedResources = getOutflowedResources(transaction); if (outflowedResources == null) { synchronized (transaction.getOutflowLock()) { outflowedResources = getOutflowedResources(transaction); if (outflowedResources == null) { transaction.putResource(outflowKey, outflowedResources = new XAOutflowedResources(transaction)); } } } SubordinateXAResource resource = outflowedResources.getOrEnlist(location, transaction.getParentName()); return resource.addHandle(resource.getXid()); }
public void rollback() throws IllegalStateException, SystemException { if (isImported()) { throw Log.log.rollbackOnImported(); } try { owner.getProvider().rollbackLocal(transaction); } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
void commitAndDissociate() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException { if (isImported()) { throw Log.log.commitOnImported(); } notifyAssociationListeners(false); try { owner.getProvider().getTransactionManager().commit(); } catch (RollbackException re) { addRollbackExceptions(re); throw re; } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException { if (isImported()) { throw Log.log.commitOnImported(); } try { owner.getProvider().commitLocal(transaction); } catch (RollbackException re) { addRollbackExceptions(re); throw re; } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
void rollbackAndDissociate() throws IllegalStateException, SystemException { if (isImported()) { throw Log.log.rollbackOnImported(); } notifyAssociationListeners(false); try { owner.getProvider().getTransactionManager().rollback(); } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
void rollbackAndDissociate() throws IllegalStateException, SystemException { if (isImported()) { throw Log.log.rollbackOnImported(); } notifyAssociationListeners(false); try { owner.getProvider().getTransactionManager().rollback(); } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
/** * Outflow the given local transaction to the given location. The returned handle * must be used to confirm or forget the enlistment attempt either immediately or at some point in the future; * failure to do so may cause the transaction to be rolled back with an error. * * @param location the location to outflow to (must not be {@code null}) * @param transaction the transaction (must not be {@code null}) * @return the enlistment handle (not {@code null}) * @throws SystemException if the transaction manager fails for some reason * @throws RollbackException if the transaction has been rolled back in the meantime * @throws IllegalStateException if no transaction is active * @throws UnsupportedOperationException if the provider for the location does not support outflow */ public XAOutflowHandle outflowTransaction(final URI location, final LocalTransaction transaction) throws SystemException, IllegalStateException, UnsupportedOperationException, RollbackException { Assert.checkNotNullParam("location", location); Assert.checkNotNullParam("transaction", transaction); XAOutflowedResources outflowedResources = getOutflowedResources(transaction); if (outflowedResources == null) { synchronized (transaction.getOutflowLock()) { outflowedResources = getOutflowedResources(transaction); if (outflowedResources == null) { transaction.putResource(outflowKey, outflowedResources = new XAOutflowedResources(transaction)); } } } SubordinateXAResource resource = outflowedResources.getOrEnlist(location, transaction.getParentName()); return resource.addHandle(resource.getXid()); }
/** * Outflow the given local transaction to the given location. The returned handle * must be used to confirm or forget the enlistment attempt either immediately or at some point in the future; * failure to do so may cause the transaction to be rolled back with an error. * * @param location the location to outflow to (must not be {@code null}) * @param transaction the transaction (must not be {@code null}) * @return the enlistment handle (not {@code null}) * @throws SystemException if the transaction manager fails for some reason * @throws RollbackException if the transaction has been rolled back in the meantime * @throws IllegalStateException if no transaction is active * @throws UnsupportedOperationException if the provider for the location does not support outflow */ public XAOutflowHandle outflowTransaction(final URI location, final LocalTransaction transaction) throws SystemException, IllegalStateException, UnsupportedOperationException, RollbackException { Assert.checkNotNullParam("location", location); Assert.checkNotNullParam("transaction", transaction); XAOutflowedResources outflowedResources = getOutflowedResources(transaction); if (outflowedResources == null) { synchronized (transaction.getOutflowLock()) { outflowedResources = getOutflowedResources(transaction); if (outflowedResources == null) { transaction.putResource(outflowKey, outflowedResources = new XAOutflowedResources(transaction)); } } } SubordinateXAResource resource = outflowedResources.getOrEnlist(location, transaction.getParentName()); return resource.addHandle(resource.getXid()); }
public void rollback() throws IllegalStateException, SystemException { if (isImported()) { throw Log.log.rollbackOnImported(); } try { owner.getProvider().rollbackLocal(transaction); } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
public void rollback() throws IllegalStateException, SystemException { if (isImported()) { throw Log.log.rollbackOnImported(); } try { owner.getProvider().rollbackLocal(transaction); } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
void commitAndDissociate() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException { if (isImported()) { throw Log.log.commitOnImported(); } notifyAssociationListeners(false); try { owner.getProvider().getTransactionManager().commit(); } catch (RollbackException re) { addRollbackExceptions(re); throw re; } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
void commitAndDissociate() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException { if (isImported()) { throw Log.log.commitOnImported(); } notifyAssociationListeners(false); try { owner.getProvider().getTransactionManager().commit(); } catch (RollbackException re) { addRollbackExceptions(re); throw re; } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException { if (isImported()) { throw Log.log.commitOnImported(); } try { owner.getProvider().commitLocal(transaction); } catch (RollbackException re) { addRollbackExceptions(re); throw re; } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException { if (isImported()) { throw Log.log.commitOnImported(); } try { owner.getProvider().commitLocal(transaction); } catch (RollbackException re) { addRollbackExceptions(re); throw re; } finally { final XAOutflowedResources outflowedResources = RemoteTransactionContext.getOutflowedResources(this); if (outflowedResources == null || outflowedResources.getEnlistedSubordinates() == 0) { // we can drop the mapping, since we are both a master and have no enlisted subordinates owner.getProvider().dropLocal(transaction); } } }