/** * Set the transaction rollback-only if the deadline has been reached, * and throw a TransactionTimedOutException. */ private void checkTransactionTimeout(boolean deadlineReached) throws TransactionTimedOutException { if (deadlineReached) { setRollbackOnly(); throw new TransactionTimedOutException("Transaction timed out: deadline was " + this.deadline); } }
/** * Set the transaction rollback-only if the deadline has been reached, * and throw a TransactionTimedOutException. */ private void checkTransactionTimeout(boolean deadlineReached) throws TransactionTimedOutException { if (deadlineReached) { setRollbackOnly(); throw new TransactionTimedOutException("Transaction timed out: deadline was " + this.deadline); } }
/** * Set the transaction rollback-only if the deadline has been reached, * and throw a TransactionTimedOutException. */ private void checkTransactionTimeout(boolean deadlineReached) throws TransactionTimedOutException { if (deadlineReached) { setRollbackOnly(); throw new TransactionTimedOutException("Transaction timed out: deadline was " + this.deadline); } }
/** * Set the transaction rollback-only if the deadline has been reached, * and throw a TransactionTimedOutException. */ private void checkTransactionTimeout(boolean deadlineReached) throws TransactionTimedOutException { if (deadlineReached) { setRollbackOnly(); throw new TransactionTimedOutException("Transaction timed out: deadline was " + this.deadline); } }
/** * Set the transaction rollback-only if the deadline has been reached, * and throw a TransactionTimedOutException. */ private void checkTransactionTimeout(boolean deadlineReached) throws TransactionTimedOutException { if (deadlineReached) { setRollbackOnly(); throw new TransactionTimedOutException("Transaction timed out: deadline was " + this.deadline); } }
@Override protected void doRollback(DefaultTransactionStatus status) { // Is there a transaction? if (!status.hasTransaction()) return; // Get transaction final JTransaction jtx = ((TxWrapper)status.getTransaction()).getJTransaction(); if (jtx == null) throw new NoTransactionException("no current JTransaction exists"); // Rollback try { if (this.logger.isTraceEnabled()) this.logger.trace("rolling back JSimpleDB transaction " + jtx); jtx.rollback(); } catch (StaleTransactionException e) { throw new TransactionTimedOutException("transaction is no longer usable", e); } catch (DatabaseException e) { throw new TransactionSystemException("error committing transaction", e); } finally { JTransaction.setCurrent(null); // transaction is no longer usable } }
@Override protected void doRollback(DefaultTransactionStatus status) { // Is there a transaction? if (!status.hasTransaction()) return; // Get transaction final JTransaction jtx = ((TxWrapper)status.getTransaction()).getJTransaction(); if (jtx == null) throw new NoTransactionException("no current JTransaction exists"); // Rollback try { if (this.logger.isTraceEnabled()) this.logger.trace("rolling back Permazen transaction " + jtx); jtx.rollback(); } catch (StaleTransactionException e) { throw new TransactionTimedOutException("transaction is no longer usable", e); } catch (DatabaseException e) { throw new TransactionSystemException("error committing transaction", e); } finally { JTransaction.setCurrent(null); // transaction is no longer usable } }
@Override protected void doCommit(DefaultTransactionStatus status) { // Is there a transaction? if (!status.hasTransaction()) return; // Get transaction final JTransaction jtx = ((TxWrapper)status.getTransaction()).getJTransaction(); if (jtx == null) throw new NoTransactionException("no current JTransaction exists"); // Commit try { if (this.logger.isTraceEnabled()) this.logger.trace("committing JSimpleDB transaction " + jtx); jtx.commit(); } catch (RetryTransactionException e) { throw new PessimisticLockingFailureException("transaction must be retried", e); } catch (StaleTransactionException e) { throw new TransactionTimedOutException("transaction is no longer usable", e); } catch (DatabaseException e) { throw new TransactionSystemException("error committing transaction", e); } finally { JTransaction.setCurrent(null); // transaction is no longer usable } }
@Override protected void doCommit(DefaultTransactionStatus status) { // Is there a transaction? if (!status.hasTransaction()) return; // Get transaction final JTransaction jtx = ((TxWrapper)status.getTransaction()).getJTransaction(); if (jtx == null) throw new NoTransactionException("no current JTransaction exists"); // Commit try { if (this.logger.isTraceEnabled()) this.logger.trace("committing Permazen transaction " + jtx); jtx.commit(); } catch (RetryTransactionException e) { throw new PessimisticLockingFailureException("transaction must be retried", e); } catch (StaleTransactionException e) { throw new TransactionTimedOutException("transaction is no longer usable", e); } catch (DatabaseException e) { throw new TransactionSystemException("error committing transaction", e); } finally { JTransaction.setCurrent(null); // transaction is no longer usable } }