org.apache.derby.iapi.store.raw.LockingPolicy
| Modifier and Type | Field and Description |
|---|---|
| private static final LockingPolicy |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| 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 void | unlockContainer(Transaction
The transaction to associate the lock with. t, ContainerHandle Container to unlock. container_handle)Overrides org. Implements org. Unlock read locks. |
| public void | unlockRecordAfterRead(Transaction t, ContainerHandle container_handle, RecordHandle record, boolean forUpdate, boolean row_qualified)
Overrides org. Implements org. Unlock a record after it has been locked for read. |
| NO_LOCK | back to summary |
|---|---|
| private static final LockingPolicy NO_LOCK Hides org. | |
| RowLocking2 | back to summary |
|---|---|
| protected RowLocking2(LockFactory lf) | |
| 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. Read locks are put in a separate "group" from the transaction, so that when the container is closed it can release these read 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. Read lock will be placed on separate group from transaction.
| |
| unlockContainer | back to summary |
|---|---|
| public void unlockContainer(Transaction t, ContainerHandle container_handle) Overrides org. Implements org. Unlock read locks. In Cursor stability release all read locks obtained. unlockContainer() will be called when the container is closed.
| |
| unlockRecordAfterRead | back to summary |
|---|---|
| public void unlockRecordAfterRead(Transaction t, ContainerHandle container_handle, RecordHandle record, boolean forUpdate, boolean row_qualified) throws StandardException Overrides org. Implements org. Doc from org. Unlock a record after it has been locked for read. In repeatable read only unlock records which "did not qualify". For example in a query like "select * from foo where a = 1" on a table with no index it is only necessary to hold locks on rows where a=1, but in the process of finding those rows the system will get locks on other rows to verify they are committed before applying the qualifier. Those locks can be released under repeatable read isolation.
| |