public synchronized void setRollbackOnly() throws IllegalStateException { switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_PREPARING: status = Status.STATUS_MARKED_ROLLBACK; break; case Status.STATUS_MARKED_ROLLBACK: case Status.STATUS_ROLLING_BACK: // nothing to do break; default: throw new IllegalStateException("Cannot set rollback only, status is " + getStateString(status)); } }
public synchronized void setRollbackOnly() throws IllegalStateException { switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_PREPARING: status = Status.STATUS_MARKED_ROLLBACK; break; case Status.STATUS_MARKED_ROLLBACK: case Status.STATUS_ROLLING_BACK: // nothing to do break; default: throw new IllegalStateException("Cannot set rollback only, status is " + getStateString(status)); } }
public synchronized void setRollbackOnly() throws IllegalStateException { switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_PREPARING: status = Status.STATUS_MARKED_ROLLBACK; break; case Status.STATUS_MARKED_ROLLBACK: case Status.STATUS_ROLLING_BACK: // nothing to do break; default: throw new IllegalStateException("Cannot set rollback only, status is " + getStateString(status)); } }
public synchronized void registerSynchronization(Synchronization synch) throws IllegalStateException, RollbackException, SystemException { if (synch == null) { throw new IllegalArgumentException("Synchronization is null"); } switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_PREPARING: break; case Status.STATUS_MARKED_ROLLBACK: throw new RollbackException("Transaction is marked for rollback"); default: throw new IllegalStateException("Status is " + getStateString(status)); } syncList.add(synch); }
public synchronized void registerSynchronization(Synchronization synch) throws IllegalStateException, RollbackException, SystemException { if (synch == null) { throw new IllegalArgumentException("Synchronization is null"); } switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_PREPARING: break; case Status.STATUS_MARKED_ROLLBACK: throw new RollbackException("Transaction is marked for rollback"); default: throw new IllegalStateException("Status is " + getStateString(status)); } syncList.add(synch); }
public synchronized void registerSynchronization(Synchronization synch) throws IllegalStateException, RollbackException, SystemException { if (synch == null) { throw new IllegalArgumentException("Synchronization is null"); } switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_PREPARING: break; case Status.STATUS_MARKED_ROLLBACK: throw new RollbackException("Transaction is marked for rollback"); default: throw new IllegalStateException("Status is " + getStateString(status)); } syncList.add(synch); }
public synchronized void registerSynchronization(Synchronization synch) throws IllegalStateException, RollbackException, SystemException { if (synch == null) { throw new IllegalArgumentException("Synchronization is null"); } switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_PREPARING: break; case Status.STATUS_MARKED_ROLLBACK: throw new RollbackException("Transaction is marked for rollback"); default: throw new IllegalStateException("Status is " + getStateString(status)); } syncList.add(synch); }
public synchronized void setRollbackOnly(Throwable reason) { switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_PREPARING: status = Status.STATUS_MARKED_ROLLBACK; markRollbackCause(reason); break; case Status.STATUS_MARKED_ROLLBACK: case Status.STATUS_ROLLING_BACK: // nothing to do break; default: throw new IllegalStateException("Cannot set rollback only, status is " + getStateString(status)); } }
private void beforePrepare() { synchronized (this) { switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_MARKED_ROLLBACK: break; default: throw new IllegalStateException("Status is " + getStateString(status)); } } beforeCompletion(); endResources(); }
private void beforePrepare() { synchronized (this) { switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_MARKED_ROLLBACK: break; default: throw new IllegalStateException("Status is " + getStateString(status)); } } beforeCompletion(); endResources(); }
private void beforePrepare() { synchronized (this) { switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_MARKED_ROLLBACK: break; default: throw new IllegalStateException("Status is " + getStateString(status)); } } beforeCompletion(); endResources(); }
private void beforePrepare() { synchronized (this) { switch (status) { case Status.STATUS_ACTIVE: case Status.STATUS_MARKED_ROLLBACK: break; default: throw new IllegalStateException("Status is " + getStateString(status)); } } beforeCompletion(); endResources(); }
break; default: throw new IllegalStateException("Status is " + getStateString(status));
break; default: throw new IllegalStateException("Status is " + getStateString(status));
break; default: throw new IllegalStateException("Status is " + getStateString(status));
break; default: throw new IllegalStateException("Status is " + getStateString(status));
public void rollback() throws IllegalStateException, SystemException { List rms; synchronized (this) { switch (status) { case Status.STATUS_ACTIVE: status = Status.STATUS_MARKED_ROLLBACK; break; case Status.STATUS_MARKED_ROLLBACK: break; default: throw new IllegalStateException("Status is " + getStateString(status)); } rms = resourceManagers; } endResources(); try { try { rollbackResources(rms, false); } catch (HeuristicMixedException e) { throw (SystemException)new SystemException("Unable to roll back due to heuristics").initCause(e); } } finally { afterCompletion(); synchronized (this) { status = Status.STATUS_NO_TRANSACTION; } } }
break; default: throw new IllegalStateException("Status is " + getStateString(status));
break; default: throw new IllegalStateException("Status is " + getStateString(status));
break; default: throw new IllegalStateException("Status is " + getStateString(status));