@Override public boolean txnLockUpgradable(long txnId, long indexId, byte[] key) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.lockUpgradable(indexId, key); } return true; }
@Override public boolean txnRollback(long txnId) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.exit(); } return true; }
@Override public boolean txnLockShared(long txnId, long indexId, byte[] key) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.lockShared(indexId, key); } return true; }
@Override public boolean txnLockExclusive(long txnId, long indexId, byte[] key) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.lockExclusive(indexId, key); } return true; }
@Override public boolean txnLockShared(long txnId, long indexId, byte[] key) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.lockShared(indexId, key); } return true; }
@Override public boolean txnLockExclusive(long txnId, long indexId, byte[] key) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.lockExclusive(indexId, key); } return true; }
@Override public boolean txnRollback(long txnId) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.exit(); } return true; }
@Override public boolean txnPrepare(long txnId) throws IOException { LocalTransaction txn = txn(txnId); if (txn != null) { txn.prepareNoRedo(); } return true; }
@Override public boolean txnRollback(long txnId) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.exit(); } return true; }
@Override public boolean txnLockUpgradable(long txnId, long indexId, byte[] key) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.lockUpgradable(indexId, key); } return true; }
@Override public boolean txnCommit(long txnId) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.commit(); txn.exit(); } return true; }
@Override public boolean txnCommit(long txnId) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.commit(); txn.exit(); } return true; }
@Override public boolean txnStore(long txnId, long indexId, byte[] key, byte[] value) throws IOException { Transaction txn = txn(txnId); if (txn != null) { Index ix = openIndex(indexId); if (ix != null) { ix.store(txn, key, value); } } return true; }
@Override public boolean txnCustom(long txnId, byte[] message) throws IOException { Transaction txn = txn(txnId); if (txn != null) { LocalDatabase db = mDatabase; TransactionHandler handler = db.mCustomTxnHandler; if (handler == null) { throw new DatabaseException("Custom transaction handler is not installed"); } handler.redo(db, txn, message); } return true; }
@Override public boolean txnCommit(long txnId) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.commit(); txn.exit(); } return true; }
@Override public boolean txnCustom(long txnId, byte[] message) throws IOException { Transaction txn = txn(txnId); if (txn != null) { LocalDatabase db = mDatabase; TransactionHandler handler = db.mCustomTxnHandler; if (handler == null) { throw new DatabaseException("Custom transaction handler is not installed"); } handler.redo(db, txn, message); } return true; }
@Override public boolean txnEnter(long txnId) throws IOException { LocalTransaction txn = txn(txnId); if (txn == null) { txn = new LocalTransaction(mDatabase, txnId, LockMode.UPGRADABLE_READ, 0L); mTransactions.insert(txnId).value = txn; } else { txn.enter(); } return true; }
@Override public boolean txnEnter(long txnId) throws IOException { LocalTransaction txn = txn(txnId); if (txn == null) { txn = new LocalTransaction(mDatabase, txnId, LockMode.UPGRADABLE_READ, 0L); mTransactions.insert(txnId).value = txn; } else { txn.enter(); } return true; }
@Override public boolean cursorValueClear(long cursorId, long txnId, long pos, long length) throws IOException { LHashTable.ObjEntry<TreeCursor> entry = mCursors.get(cursorId); if (entry != null) { LocalTransaction txn = txn(txnId); if (txn != null) { readyCursorValueOp(entry, txn).valueClear(pos, length); } } return true; }
@Override public boolean txnEnter(long txnId) throws IOException { LocalTransaction txn = txn(txnId); if (txn == null) { txn = new LocalTransaction(mDatabase, txnId, LockMode.UPGRADABLE_READ, 0L); mTransactions.insert(txnId).value = txn; } else { txn.enter(); } return true; }