private void checkAndPotentiallyWaitUntilUnlocked(String name, RedisConnection connection) { if (!isLockingCacheWriter()) { return; } try { while (doCheckLock(name, connection)) { Thread.sleep(sleepTime.toMillis()); } } catch (InterruptedException ex) { // Re-interrupt current thread, to allow other participants to react. Thread.currentThread().interrupt(); throw new PessimisticLockingFailureException(String.format("Interrupted while waiting to unlock cache %s", name), ex); } }
return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); return new CannotAcquireLockException(ex.getMessage(), ex.getCause()); return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); return new CannotAcquireLockException(ex.getMessage(), ex.getCause()); return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); return new CannotAcquireLockException(ex.getMessage(), ex.getCause()); return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); return new CannotAcquireLockException(ex.getMessage(), ex.getCause()); return new PessimisticLockingFailureException(ex.getMessage(), ex);
public void invokeException() { throw new PessimisticLockingFailureException(""); }
private void checkAndPotentiallyWaitUntilUnlocked(String name, RedisConnection connection) { if (!isLockingCacheWriter()) { return; } try { while (doCheckLock(name, connection)) { Thread.sleep(sleepTime.toMillis()); } } catch (InterruptedException ex) { // Re-interrupt current thread, to allow other participants to react. Thread.currentThread().interrupt(); throw new PessimisticLockingFailureException(String.format("Interrupted while waiting to unlock cache %s", name), ex); } }
private void checkAndPotentiallyWaitUntilUnlocked(String name, RedisConnection connection) { if (!isLockingCacheWriter()) { return; } try { while (doCheckLock(name, connection)) { Thread.sleep(sleepTime.toMillis()); } } catch (InterruptedException ex) { // Re-interrupt current thread, to allow other participants to react. Thread.currentThread().interrupt(); throw new PessimisticLockingFailureException(String.format("Interrupted while waiting to unlock cache %s", name), ex); } }
return new PessimisticLockingFailureException(ex.getMessage(), ex);
@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 } }
return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); return new CannotAcquireLockException(ex.getMessage(), ex.getCause()); return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); return new CannotAcquireLockException(ex.getMessage(), ex.getCause()); return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage(), ex); return new PessimisticLockingFailureException(ex.getMessage(), ex); return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage(), ex); return new PessimisticLockingFailureException(ex.getMessage(), ex); return new PessimisticLockingFailureException(ex.getMessage(), ex);
return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);