/** * Verifies if a transaction is currently active. Throws a {@link SailException} if no transaction is * active. * * @throws SailException * if no transaction is active. */ protected void verifyIsActive() throws SailException { if (!isActive()) { throw new SailException("No active transaction"); } }
/** * If there are no open operations. * * @throws SailException */ private void flushPendingUpdates() throws SailException { if (!isActiveOperation() || isActive() && !getTransactionIsolation().isCompatibleWith(IsolationLevels.SNAPSHOT_READ)) { flush(); } }
/** * Verifies if a transaction is currently active. Throws a {@link SailException} if no transaction is * active. * * @throws SailException * if no transaction is active. */ protected void verifyIsActive() throws SailException { if (!isActive()) { throw new SailException("No active transaction"); } }
/** * If there are no open operations. * * @throws SailException */ private void flushPendingUpdates() throws SailException { if (!isActiveOperation() || isActive() && !getTransactionIsolation().isCompatibleWith(IsolationLevels.SNAPSHOT_READ)) { flush(); } }
@Override public void flush() throws SailException { if (isActive()) { endUpdate(null); startUpdate(null); } }
@Override public void flush() throws SailException { if (isActive()) { endUpdate(null); startUpdate(null); } }
@Override public final void prepare() throws SailException { if (isActive()) { endUpdate(null); } connectionLock.readLock().lock(); try { verifyIsOpen(); updateLock.lock(); try { if (txnActive) { prepareInternal(); txnPrepared = true; } } finally { updateLock.unlock(); } } finally { connectionLock.readLock().unlock(); } }
@Override public final void prepare() throws SailException { if (isActive()) { endUpdate(null); } connectionLock.readLock().lock(); try { verifyIsOpen(); updateLock.lock(); try { if (txnActive) { prepareInternal(); txnPrepared = true; } } finally { updateLock.unlock(); } } finally { connectionLock.readLock().unlock(); } }
@Override public final void commit() throws SailException { if (isActive()) { endUpdate(null); } connectionLock.readLock().lock(); try { verifyIsOpen(); updateLock.lock(); try { if (txnActive) { if (!txnPrepared) { prepareInternal(); } commitInternal(); txnActive = false; txnPrepared = false; } } finally { updateLock.unlock(); } } finally { connectionLock.readLock().unlock(); } }
@Override public final void commit() throws SailException { if (isActive()) { endUpdate(null); } connectionLock.readLock().lock(); try { verifyIsOpen(); updateLock.lock(); try { if (txnActive) { if (!txnPrepared) { prepareInternal(); } commitInternal(); txnActive = false; txnPrepared = false; } } finally { updateLock.unlock(); } } finally { connectionLock.readLock().unlock(); } }
if (isActive()) { throw new SailException("a transaction is already active on this connection.");
if (isActive()) { throw new SailException("a transaction is already active on this connection.");