org.apache.derby.iapi.store.raw.LockingPolicy
| Modifier and Type | Field and Description |
|---|---|
| protected final LockFactory | |
| private static final LockingPolicy |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public int | getMode()
Overrides org. Implements org. Get the mode of this policy |
| protected RowLock | Returns: The lock type of a shared lock for this locking policy.Get type of lock to get while reading data. |
| protected RowLock | Returns: The lock type of a shared lock for this locking policy.Get type of lock to get while requesting "update" lock. |
| protected RowLock | Returns: The lock type of a shared lock for this locking policy.Get type of lock to get while writing data. |
| public boolean | 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.Transaction to associate lock with. t, ContainerHandle Container to lock. container, boolean Should lock request wait until granted? waitForLock, boolean Should container be locked for update, or read? forUpdate)Overrides org. Implements org. Obtain container level intent lock. |
| public boolean | Returns: true if the lock was granted, false if waitForLock was false and the lock could not be granted.The transaction to associate the lock with. t, ContainerHandle Open Container used to get record. Will be used
to row locks by the container they belong to. container_handle, RecordHandle The record to be locked. record, boolean Should lock request wait until granted? waitForLock, boolean Whether to open for read or write access. forUpdate)Overrides org. Implements org. Obtain lock on record being read. |
| public boolean | Returns: true if the lock was granted, false if waitForLock was false and the lock could not be granted.The transaction to associate the lock with. t, RecordHandle The record to be locked. record, boolean Lock is for an insert. lockForInsert, boolean Should lock request wait until granted? waitForLock)Overrides org. Implements org. Obtain lock on record being written. |
| public boolean | Returns: true if the lock was granted, false if waitForLock was false and the lock could not be granted.transaction to associate the lock with. t, RecordHandle The record to be locked. record, boolean Lock is for a previous key of a insert. lockForInsertPreviousKey, boolean Should lock request wait until granted? waitForLock)Overrides org. Implements org. Obtain lock on record being written. |
| lf | back to summary |
|---|---|
| protected final LockFactory lf | |
| NO_LOCK | back to summary |
|---|---|
| private static final LockingPolicy NO_LOCK | |
| RowLocking3 | back to summary |
|---|---|
| protected RowLocking3(LockFactory lf) | |
| getMode | back to summary |
|---|---|
| public int getMode() Overrides org. Implements org. Doc from org. Get the mode of this policy | |
| getReadLockType | back to summary |
|---|---|
| protected RowLock getReadLockType() Get type of lock to get while reading data. This routine is provided so that class's like RowLockingRR can override just this routine to get RS2 locks vs RS3 locks, and still reuse all the other code in this class.
| |
| getUpdateLockType | back to summary |
|---|---|
| protected RowLock getUpdateLockType() Get type of lock to get while requesting "update" lock. This routine is provided so that class's like RowLockingRR can override just this routine to get RU2 locks vs RU3 locks, and still reuse all the other code in this class.
| |
| getWriteLockType | back to summary |
|---|---|
| protected RowLock getWriteLockType() Get type of lock to get while writing data. This routine is provided so that class's like RowLockingRR can override just this routine to get RX2 locks vs RX3 locks, and still reuse all the other code in this class.
| |
| lockContainer | back to summary |
|---|---|
| public boolean lockContainer(Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) throws StandardException Overrides org. Implements org. Obtain container level intent lock. This implementation of row locking is 2 level, ie. table and row locking. It will interact correctly with tables opened with ContainerLocking3 locking mode. Updater's will get table level IX locks, and X row locks. Reader's will get table level IS locks, and S row locks.
| |
| lockRecordForRead | back to summary |
|---|---|
| public boolean lockRecordForRead(Transaction t, ContainerHandle container_handle, RecordHandle record, boolean waitForLock, boolean forUpdate) throws StandardException Overrides org. Implements org. Obtain lock on record being read. Assumes that a table level IS has been acquired. Will acquire a Shared or Update lock on the row, depending on the "forUpdate" parameter.
| |
| lockRecordForWrite | back to summary |
|---|---|
| public boolean lockRecordForWrite(Transaction t, RecordHandle record, boolean lockForInsert, boolean waitForLock) throws StandardException Overrides org. Implements org. Obtain lock on record being written. Assumes that a table level IX has been acquired. Will acquire an Exclusive (X) lock on the row.
| |
| zeroDurationLockRecordForWrite | back to summary |
|---|---|
| public boolean zeroDurationLockRecordForWrite(Transaction t, RecordHandle record, boolean lockForInsertPreviousKey, boolean waitForLock) throws StandardException Overrides org. Implements org. Obtain lock on record being written. Assumes that a table level IX has been acquired. Will acquire an Exclusive (X) lock on the row.
| |