@Override public final void reset(Throwable cause) { if (cause == null) { try { reset(); } catch (Throwable e) { // Ignore. } } else { borked(cause, true, false); } }
@Override public final void reset(Throwable cause) { if (cause == null) { try { reset(); } catch (Throwable e) { // Ignore. Transaction is borked as a side-effect. } } else { borked(cause, true, false); // rollback = true, rethrow = false } }
@Override public final void reset(Throwable cause) { if (cause == null) { try { reset(); } catch (Throwable e) { // Ignore. Transaction is borked as a side-effect. } } else { borked(cause, true, false); // rollback = true, rethrow = false } }
@Override public final void reset() { if (mBorked == null) { try { rollback(); } catch (Throwable e) { borked(e, true, false); // rollback = true, rethrow = false } } else { super.scopeExitAll(); } }
@Override public final void reset() { if (mBorked == null) { try { rollback(); } catch (Throwable e) { borked(e, true, false); // rollback = true, rethrow = false } } else { super.scopeExitAll(); } }
private long doRedoCursorRegister(TreeCursor cursor) throws IOException { long cursorId = mContext.nextTransactionId(); try { mContext.redoCursorRegister(mRedo, cursorId, cursor.mTree.mId); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } cursor.mCursorId = cursorId; return cursorId; }
/** * To be called during redo recovery. */ final void prepareNoRedo() throws IOException { check(); try { if ((mHasState & HAS_PREPARE) == 0) { pushUndoPrepare(); mHasState |= HAS_PREPARE; } } catch (Throwable e) { borked(e, true, true); // rollback = true, rethrow = true } }
/** * Caller must hold commit lock. */ final void pushUnextend(long indexId, byte[] key, long length) throws IOException { check(); try { undoLog().pushUnextend(mSavepoint, indexId, key, length); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
/** * Caller must hold commit lock. */ final void pushUnalloc(long indexId, byte[] key, long pos, long length) throws IOException { check(); try { undoLog().pushUnalloc(indexId, key, pos, length); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
/** * Caller must hold commit lock. */ final void pushUninsert(long indexId, byte[] key) throws IOException { check(); try { undoLog().push(indexId, UndoLog.OP_UNINSERT, key, 0, key.length); } catch (Throwable e) { borked(e, false, true); } }
/** * Caller must hold commit lock. */ final void pushUninsert(long indexId, byte[] key) throws IOException { check(); try { undoLog().pushUninsert(indexId, key); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
/** * Caller must hold commit lock. */ final void pushUninsert(long indexId, byte[] key) throws IOException { check(); try { undoLog().pushUninsert(indexId, key); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
/** * Caller must hold commit lock. */ final void pushUncreate(long indexId, byte[] key) throws IOException { check(); try { undoLog().pushUncreate(indexId, key); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
/** * Caller must hold commit lock. */ final void pushUnwrite(long indexId, byte[] key, long pos, /*P*/ byte[] b, int off, int len) throws IOException { check(); try { undoLog().pushUnwrite(indexId, key, pos, b, off, len); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
/** * Caller must hold commit lock. * * @param op OP_UNUPDATE or OP_UNDELETE * @param payload page with Node-encoded key/value entry */ final void pushUndoStore(long indexId, byte op, /*P*/ byte[] payload, int off, int len) throws IOException { check(); try { undoLog().pushNodeEncoded(indexId, op, payload, off, len); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
/** * Caller must hold commit lock. * * @param payload Node-encoded key followed by trash id */ final void pushUndeleteFragmented(long indexId, byte[] payload, int off, int len) throws IOException { check(); try { undoLog().push(indexId, UndoLog.OP_UNDELETE_FRAGMENTED, payload, off, len); } catch (Throwable e) { borked(e, false, true); } }
/** * Caller must hold commit lock. * * @param payload Node-encoded key followed by trash id */ final void pushUndeleteFragmented(long indexId, byte[] payload, int off, int len) throws IOException { check(); try { undoLog().pushNodeEncoded(indexId, UndoLog.OP_UNDELETE_FRAGMENTED, payload, off, len); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
/** * Caller must hold commit lock. * * @param payload Node-encoded key followed by trash id */ final void pushUndeleteFragmented(long indexId, byte[] payload, int off, int len) throws IOException { check(); try { undoLog().pushNodeEncoded(indexId, UndoLog.OP_UNDELETE_FRAGMENTED, payload, off, len); } catch (Throwable e) { borked(e, false, true); // rollback = false, rethrow = true } }
@Override public final void customUndo(byte[] message) throws IOException { if (mDatabase.mCustomTxnHandler == null) { throw new IllegalStateException("Custom transaction handler is not installed"); } check(); final CommitLock.Shared shared = mDatabase.commitLock().acquireShared(); try { undoLog().pushCustom(message); } catch (Throwable e) { borked(e, true, true); // rollback = true, rethrow = true } finally { shared.release(); } }
@Override public final void customUndo(byte[] message) throws IOException { if (mDatabase.mCustomTxnHandler == null) { throw new IllegalStateException("Custom transaction handler is not installed"); } check(); final CommitLock.Shared shared = mDatabase.commitLock().acquireShared(); try { undoLog().pushCustom(message); } catch (Throwable e) { borked(e, true, true); // rollback = true, rethrow = true } finally { shared.release(); } }