public void setXid(BitronixXid xid) throws BitronixSystemException { if (log.isDebugEnabled()) log.debug("assigning <" + xid + "> to <" + this + ">"); if (this.xid != null && !xid.equals(this.xid)) throw new BitronixSystemException("a XID has already been assigned to " + this); this.xid = xid; }
public BitronixSystemException(String string, Throwable t) { super(string); initCause(t); }
public void setXid(BitronixXid xid) throws BitronixSystemException { if (log.isDebugEnabled()) log.debug("assigning <" + xid + "> to <" + this + ">"); if (this.xid != null && !xid.equals(this.xid)) throw new BitronixSystemException("a XID has already been assigned to " + this); this.xid = xid; }
public BitronixSystemException(String string, Throwable t) { super(string); initCause(t); }
public void setXid(BitronixXid xid) throws BitronixSystemException { if (log.isDebugEnabled()) { log.debug("assigning <" + xid + "> to <" + this + ">"); } if (this.xid != null && !xid.equals(this.xid)) throw new BitronixSystemException("a XID has already been assigned to " + this); this.xid = xid; hashCode = 17 * (bean.hashCode() + (xid != null ? xid.hashCode() : 0)); }
public BitronixSystemException(String string, Throwable t) { super(string); initCause(t); }
public void setXid(BitronixXid xid) throws BitronixSystemException { if (log.isDebugEnabled()) { log.debug("assigning <" + xid + "> to <" + this + ">"); } if (this.xid != null && !xid.equals(this.xid)) throw new BitronixSystemException("a XID has already been assigned to " + this); this.xid = xid; hashCode = 17 * (bean.hashCode() + (xid != null ? xid.hashCode() : 0)); }
public BitronixSystemException(String string, Throwable t) { super(string); initCause(t); }
@Override public void setTransactionTimeout(int seconds) throws SystemException { if (seconds < 0) throw new BitronixSystemException("cannot set a timeout to less than 0 second (was: " + seconds + "s)"); ThreadContext.getThreadContext().setTimeout(seconds); }
public void setTransactionTimeout(int seconds) throws SystemException { if (seconds < 0) throw new BitronixSystemException("cannot set a timeout to less than 0 second (was: " + seconds + "s)"); getOrCreateCurrentContext().setTimeout(seconds); }
@Override public void setTransactionTimeout(int seconds) throws SystemException { if (seconds < 0) throw new BitronixSystemException("cannot set a timeout to less than 0 second (was: " + seconds + "s)"); ThreadContext.getThreadContext().setTimeout(seconds); }
public void setTransactionTimeout(int seconds) throws SystemException { if (seconds < 0) throw new BitronixSystemException("cannot set a timeout to less than 0 second (was: " + seconds + "s)"); getOrCreateCurrentContext().setTimeout(seconds); }
throw new IllegalStateException("transaction hasn't started yet"); if (flag != XAResource.TMSUCCESS && flag != XAResource.TMSUSPEND && flag != XAResource.TMFAIL) throw new BitronixSystemException("can only delist with SUCCESS, SUSPEND, FAIL - was: " + Decoder.decodeXAResourceFlag(flag)); if (isWorking()) throw new IllegalStateException("transaction is being committed or rolled back, cannot delist any resource now"); throw new BitronixSystemException("unknown XAResource " + xaResource + ", it does not belong to a registered resource");
throw new IllegalStateException("transaction hasn't started yet"); if (flag != XAResource.TMSUCCESS && flag != XAResource.TMSUSPEND && flag != XAResource.TMFAIL) throw new BitronixSystemException("can only delist with SUCCESS, SUSPEND, FAIL - was: " + Decoder.decodeXAResourceFlag(flag)); if (isWorking()) throw new IllegalStateException("transaction is being committed or rolled back, cannot delist any resource now"); throw new BitronixSystemException("unknown XAResource " + xaResource + ", it does not belong to a registered resource");
throw new BitronixSystemException("transaction partly committed and partly rolled back. Resources are now inconsistent !", ex); } catch (HeuristicCommitException ex) { throw new BitronixSystemException("transaction committed instead of rolled back. Resources are now inconsistent !", ex);
throw new BitronixSystemException("transaction partly committed and partly rolled back. Resources are now inconsistent !", ex); } catch (HeuristicCommitException ex) { throw new BitronixSystemException("transaction committed instead of rolled back. Resources are now inconsistent !", ex);
throw new BitronixSystemException("transaction partly committed and partly rolled back. Resources are now inconsistent !", ex); } catch (HeuristicCommitException ex) { throw new BitronixSystemException("transaction committed instead of rolled back. Resources are now inconsistent !", ex);
throw new BitronixSystemException("transaction partly committed and partly rolled back. Resources are now inconsistent !", ex); } catch (HeuristicCommitException ex) { throw new BitronixSystemException("transaction committed instead of rolled back. Resources are now inconsistent !", ex);
/** * Rollback resources after a phase 1 prepare failure. All resources must be rolled back as prepared ones * are in-doubt and non-prepared ones have started/ended work done that must also be cleaned. * @param rbEx the thrown rollback exception. * @throws BitronixSystemException when a resource could not rollback prepapared state. */ private void rollbackPrepareFailure(RollbackException rbEx) throws BitronixSystemException { List<XAResourceHolderState> interestedResources = resourceManager.getAllResources(); try { rollbacker.rollback(this, interestedResources); if (log.isDebugEnabled()) { log.debug("rollback after prepare failure succeeded"); } } catch (Exception ex) { // let's merge both exceptions' PhaseException to report a complete error message PhaseException preparePhaseEx = (PhaseException) rbEx.getCause(); PhaseException rollbackPhaseEx = (PhaseException) ex.getCause(); List<Exception> exceptions = new ArrayList<Exception>(); List<XAResourceHolderState> resources = new ArrayList<XAResourceHolderState>(); exceptions.addAll(preparePhaseEx.getExceptions()); exceptions.addAll(rollbackPhaseEx.getExceptions()); resources.addAll(preparePhaseEx.getResourceStates()); resources.addAll(rollbackPhaseEx.getResourceStates()); throw new BitronixSystemException("transaction partially prepared and only partially rolled back. Some resources might be left in doubt!", new PhaseException(exceptions, resources)); } }
/** * Rollback resources after a phase 1 prepare failure. All resources must be rolled back as prepared ones * are in-doubt and non-prepared ones have started/ended work done that must also be cleaned. * @param rbEx the thrown rollback exception. * @throws BitronixSystemException when a resource could not rollback prepapared state. */ private void rollbackPrepareFailure(RollbackException rbEx) throws BitronixSystemException { List<XAResourceHolderState> interestedResources = resourceManager.getAllResources(); try { rollbacker.rollback(this, interestedResources); if (log.isDebugEnabled()) log.debug("rollback after prepare failure succeeded"); } catch (Exception ex) { // let's merge both exceptions' PhaseException to report a complete error message PhaseException preparePhaseEx = (PhaseException) rbEx.getCause(); PhaseException rollbackPhaseEx = (PhaseException) ex.getCause(); List<Exception> exceptions = new ArrayList<Exception>(); List<XAResourceHolderState> resources = new ArrayList<XAResourceHolderState>(); exceptions.addAll(preparePhaseEx.getExceptions()); exceptions.addAll(rollbackPhaseEx.getExceptions()); resources.addAll(preparePhaseEx.getResourceStates()); resources.addAll(rollbackPhaseEx.getResourceStates()); throw new BitronixSystemException("transaction partially prepared and only partially rolled back. Some resources might be left in doubt!", new PhaseException(exceptions, resources)); } }