@Override public void init() { try { ResourceRegistrar.register(this); } catch (RecoveryException ex) { throw new BitronixRuntimeException("error recovering " + this, ex); } }
public XAResourceHolderState startRecovery() throws RecoveryException { if (recoveryXAResourceHolder != null) { throw new RecoveryException("recovery already in progress on " + this); } if (xaResourceHolders.isEmpty()) { throw new RecoveryException("no XAResource registered, recovery cannot be done on " + this); } recoveryXAResourceHolder = new RecoveryXAResourceHolder(xaResourceHolders.values().iterator().next()); return new XAResourceHolderState(recoveryXAResourceHolder, this); }
@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); }
/** * Get the transaction currently registered on the current thread context. * @return the current transaction or null if no transaction has been started on the current thread. */ public BitronixTransaction getCurrentTransaction() { return ThreadContext.getThreadContext().getTransaction(); }
public BitronixXAException(String message, int errorCode, Throwable t) { super(message); this.errorCode = errorCode; initCause(t); }
@Override protected ThreadContext initialValue() { return new ThreadContext(); } };
public BitronixHeuristicCommitException(String string, Throwable t) { super(string); initCause(t); }
public BitronixSystemException(String string, Throwable t) { super(string); initCause(t); }
public BitronixHeuristicMixedException(String string, Throwable t) { super(string); initCause(t); }
public BitronixHeuristicRollbackException(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); }
/** * Get the transaction currently registered on the current thread context. * @return the current transaction or null if no transaction has been started on the current thread. */ public BitronixTransaction getCurrentTransaction() { return ThreadContext.getThreadContext().getTransaction(); }
public BitronixXAException(String message, int errorCode, Throwable t) { super(message); this.errorCode = errorCode; initCause(t); }
@Override protected ThreadContext initialValue() { return new ThreadContext(); } };
public BitronixXAException(String message, int errorCode, Throwable t) { super(message); this.errorCode = errorCode; initCause(t); }
public BitronixXAException(String message, int errorCode, Throwable t) { super(message); this.errorCode = errorCode; initCause(t); }