Documentation of 'org.apache.derby.impl.store.raw.xact.ContainerLocking2' Java class
ContainerLocking2
org.apache.derby.impl.store.raw.xact

Class ContainerLocking2

  • All Implemented Interfaces:
    LockingPolicy


    public class ContainerLocking2
    extends java.lang.Object
    A locking policy that implements container level locking with isolation degree 2.
    See Also:
    LockingPolicy
    • Method Detail

      • lockContainer

        public boolean lockContainer(Transaction t,
                                     ContainerHandle container,
                                     boolean waitForLock,
                                     boolean forUpdate)
                              throws StandardException
        Obtain a Container shared or exclusive lock until the end of the nested transaction.
        Specified by:
        lockContainer in interface LockingPolicy
        Parameters:
        t - Transaction to associate lock with.
        container - Container to lock.
        waitForLock - Should lock request wait until granted?
        forUpdate - Should container be locked for update, or read?
        Returns:
        true if the lock was obtained, false if it wasn't. False should only be returned if the waitForLock policy was set to "false," and the lock was unavailable.
        Throws:
        StandardException - Standard Derby error policy
        See Also:
        ContainerHandle
      • lockRecordForRead

        public boolean lockRecordForRead(Transaction t,
                                         ContainerHandle container,
                                         RecordHandle record,
                                         boolean waitForLock,
                                         boolean forUpdate)
                                  throws StandardException
        Description copied from interface: LockingPolicy
        Called before a record is fetched.
        Specified by:
        lockRecordForRead in interface LockingPolicy
        Parameters:
        t - Transaction to associate lock with.
        container - Open Container used to get record. Will be used to row locks by the container they belong to.
        record - Record to lock.
        waitForLock - Should lock request wait until granted?
        forUpdate - Should container be locked for update, or read?
        Throws:
        StandardException - Standard Derby error policy
        See Also:
        Page
      • zeroDurationLockRecordForWrite

        public boolean zeroDurationLockRecordForWrite(Transaction t,
                                                      RecordHandle record,
                                                      boolean lockForPreviousKey,
                                                      boolean waitForLock)
                                               throws StandardException
        Description copied from interface: LockingPolicy
        Request a write lock which will be released immediately upon grant.
        Specified by:
        zeroDurationLockRecordForWrite in interface LockingPolicy
        Parameters:
        t - Transaction to associate lock with.
        record - Record to lock.
        lockForPreviousKey - Lock is for a previous key of a insert.
        waitForLock - Should lock request wait until granted?
        Returns:
        true if the lock was obtained, false if it wasn't. False should only be returned if the waitForLock argument was set to "false," and the lock was unavailable.
        Throws:
        StandardException - Standard Derby error policy
        See Also:
        Page
      • lockRecordForWrite

        public boolean lockRecordForWrite(Transaction t,
                                          RecordHandle record,
                                          boolean lockForInsert,
                                          boolean waitForLock)
                                   throws StandardException
        Description copied from interface: LockingPolicy
        Called before a record is inserted, updated or deleted. If zeroDuration is true then lock is released immediately after it has been granted.
        Specified by:
        lockRecordForWrite in interface LockingPolicy
        Parameters:
        t - Transaction to associate lock with.
        record - Record to lock.
        lockForInsert - Lock is for an insert.
        waitForLock - Should lock request wait until granted?
        Returns:
        true if the lock was obtained, false if it wasn't. False should only be returned if the waitForLock argument was set to "false," and the lock was unavailable.
        Throws:
        StandardException - Standard Derby error policy
        See Also:
        Page

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.