public boolean begin(String lockName, int lockLevel) { logBegin0(lockName, lockLevel); if (isTransactionLoggingDisabled() || objectManager.isCreationInProgress()) { return false; } final TxnType txnType = getTxnTypeFromLockLevel(lockLevel); ClientTransaction currentTransaction = getTransactionOrNull(); final LockID lockID = lockManager.lockIDFor(lockName); pushTxContext(lockID, txnType); if (currentTransaction == null) { createTxAndInitContext(); } else { currentTransaction.setTransactionContext(this.peekContext()); } lockManager.lock(lockID, lockLevel); return true; }
public void lock(String lockName, int lockLevel) { final LockID lockID = lockManager.lockIDFor(lockName); lockManager.lock(lockID, lockLevel); }