/** * Reset the transaction due to the given cause. This provides an opportunity to prevent * this transaction from being used any further. No exception is thrown when invoking this * method. * * @param cause pass a cause to reset and disable the transaction; pass null to simply * reset the transaction and ignore any exception when doing so */ default void reset(Throwable cause) { try { reset(); } catch (Throwable e) { // Ignore. } }
/** * Reset the transaction due to the given cause. This provides an opportunity to prevent * this transaction from being used any further. No exception is thrown when invoking this * method. * * @param cause pass a cause to reset and disable the transaction; pass null to simply * reset the transaction and ignore any exception when doing so */ default void reset(Throwable cause) { try { reset(); } catch (Throwable e) { // Ignore. } }
/** * Reset the transaction due to the given cause. This provides an opportunity to prevent * this transaction from being used any further. No exception is thrown when invoking this * method. * * @param cause pass a cause to reset and disable the transaction; pass null to simply * reset the transaction and ignore any exception when doing so */ default void reset(Throwable cause) { try { reset(); } catch (Throwable e) { // Ignore. } }
@Override public void rollback() throws BackendException { log.trace("rollback txn={}, id={}", txn, id); try { txn.reset(); } catch (IOException e) { throw new PermanentBackendException("unable to commit tx " + id, e); } } }
@Override public boolean txnRollbackFinal(long txnId) throws IOException { checkHighest(txnId); Transaction txn = mTransactions.removeValue(txnId); if (txn != null) { txn.reset(); } return true; }
@Override public boolean txnRollbackFinal(long txnId) throws IOException { checkHighest(txnId); Transaction txn = mTransactions.removeValue(txnId); if (txn != null) { txn.reset(); } return true; }
@Override public boolean txnRollbackFinal(long txnId) throws IOException { checkHighest(txnId); Transaction txn = mTransactions.removeValue(txnId); if (txn != null) { txn.reset(); } return true; }
@Override public boolean txnRollbackFinal(long txnId) throws IOException { checkHighest(txnId); Transaction txn = mTransactions.removeValue(txnId); if (txn != null) { txn.reset(); } return true; }
@Override public boolean txnRollbackFinal(long txnId) throws IOException { checkHighest(txnId); Transaction txn = mTransactions.removeValue(txnId); if (txn != null) { txn.reset(); } return true; }
@Override public boolean txnRollbackFinal(long txnId) throws IOException { checkHighest(txnId); Transaction txn = mTransactions.removeValue(txnId); if (txn != null) { txn.reset(); } return true; }
static void commit(Cursor c, byte[] value) throws IOException { try { c.store(value); } catch (Throwable e) { Transaction txn = c.link(); if (txn != null) { txn.reset(e); } throw e; } Transaction txn = c.link(); if (txn != null && txn != Transaction.BOGUS) { txn.commit(); } }
static void commit(Cursor c, byte[] value) throws IOException { try { c.store(value); } catch (Throwable e) { Transaction txn = c.link(); if (txn != null) { txn.reset(e); } throw e; } Transaction txn = c.link(); if (txn != null && txn != Transaction.BOGUS) { txn.commit(); } }
static void commit(Cursor c, byte[] value) throws IOException { try { c.store(value); } catch (Throwable e) { Transaction txn = c.link(); if (txn != null) { txn.reset(e); } throw e; } Transaction txn = c.link(); if (txn != null && txn != Transaction.BOGUS) { txn.commit(); } }
private void txnStore(byte[] key, byte[] value) throws IOException { Transaction txn = mDatabase.newAlwaysRedoTransaction(); try { TreeCursor c = new TreeCursor(this, txn); try { c.mKeyOnly = true; c.doFind(key); c.commit(value); } finally { c.reset(); } } catch (Throwable e) { txn.reset(); throw e; } }
private void txnStore(byte[] key, byte[] value) throws IOException { Transaction txn = mDatabase.newAlwaysRedoTransaction(); try { TreeCursor c = new TxnTreeCursor(this, txn); try { c.mKeyOnly = true; c.doFind(key); c.commit(value); } finally { c.reset(); } } catch (Throwable e) { txn.reset(); throw e; } }
private byte[] txnExchange(byte[] key, byte[] value) throws IOException { Transaction txn = mDatabase.newAlwaysRedoTransaction(); try { _TreeCursor c = new _TxnTreeCursor(this, txn); try { c.doFind(key); byte[] oldValue = c.mValue; c.commit(value); return oldValue; } finally { c.reset(); } } catch (Throwable e) { txn.reset(); throw e; } }
private void txnStore(byte[] key, byte[] value) throws IOException { Transaction txn = mDatabase.newAlwaysRedoTransaction(); try { _TreeCursor c = new _TxnTreeCursor(this, txn); try { c.mKeyOnly = true; c.doFind(key); c.commit(value); } finally { c.reset(); } } catch (Throwable e) { txn.reset(); throw e; } }
private void txnStore(byte[] key, byte[] value) throws IOException { Transaction txn = mDatabase.newAlwaysRedoTransaction(); try { _TreeCursor c = new _TreeCursor(this, txn); try { c.mKeyOnly = true; c.doFind(key); c.commit(value); } finally { c.reset(); } } catch (Throwable e) { txn.reset(); throw e; } }
private byte[] txnExchange(byte[] key, byte[] value) throws IOException { Transaction txn = mDatabase.newAlwaysRedoTransaction(); try { _TreeCursor c = new _TreeCursor(this, txn); try { c.doFind(key); byte[] oldValue = c.mValue; c.commit(value); return oldValue; } finally { c.reset(); } } catch (Throwable e) { txn.reset(); throw e; } }
private byte[] txnExchange(byte[] key, byte[] value) throws IOException { Transaction txn = mDatabase.newAlwaysRedoTransaction(); try { TreeCursor c = new TreeCursor(this, txn); try { c.doFind(key); byte[] oldValue = c.mValue; c.commit(value); return oldValue; } finally { c.reset(); } } catch (Throwable e) { txn.reset(); throw e; } }