Top Description Constructors Methods
org.apache.derby.impl.store.access.btree.index

pack-priv Class B2IRowLocking1

extends B2IRowLocking2
implements BTreeLockingPolicy
Class Inheritance
All Implemented Interfaces
org.apache.derby.impl.store.access.btree.BTreeLockingPolicy
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.ConglomerateController, org.apache.derby.iapi.types.RowLocation, .DataValueDescriptor, org.apache.derby.iapi.store.raw.FetchDescriptor, .LockingPolicy, .Transaction, org.apache.derby.impl.store.access.btree.BTree, .BTreeLockingPolicy, .BTreeRowPosition, .OpenBTree

The btree locking policy which implements read uncommitted isolation level. It inherits all functionality from B2IRowLocking2 except that it does not get any read row locks (and thus does not release them). Note that table level and table level intent locking remains the same as B2IRowLocking2 as this is currently the way we prevent concurrent ddl from happening while a read uncommitted scanner is operating in the btree.

Constructor Summary

AccessConstructor and Description
pack-priv
B2IRowLocking1(Transaction rawtran, int lock_level, LockingPolicy locking_policy, ConglomerateController base_cc, OpenBTree open_btree)

Constructors for This class:

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

Whether locks were acquired without releasing latch on leaf.
lockScanRow
(OpenBTree
The open_btree to associate latches with - used if routine has to scan backward.
open_btree
,
BTreeRowPosition
The position of the row to lock.
pos
,
FetchDescriptor lock_fetch_desc, DataValueDescriptor[]
A scratch area to use to read in rows.
lock_template
,
RowLocation lock_row_loc, boolean
Is this a previous key lock call?
previous_key_lock
,
boolean
Is the scan for update or for read only.
forUpdate
,
int
For what operation are we requesting the lock, this should be one of the following 4 options: LOCK_READ [read lock], (LOCK_INS | LOCK_UPD) [ lock for insert], (LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for previous key to insert], (LOCK_UPD) [lock for delete or replace]
lock_operation
)

Overrides org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow.

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

Lock a row as part of doing the scan.

public void
unlockScanRecordAfterRead(BTreeRowPosition
The position of the row to unlock.
pos
,
boolean
Is the scan for update or for read only.
forUpdate
)

Overrides org.apache.derby.impl.store.access.btree.index.B2IRowLocking2.unlockScanRecordAfterRead.

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.unlockScanRecordAfterRead.

Release read lock on a row.

Constructor Detail

B2IRowLocking1back to summary
pack-priv B2IRowLocking1(Transaction rawtran, int lock_level, LockingPolicy locking_policy, ConglomerateController base_cc, OpenBTree open_btree)

Constructors for This class:

Method Detail

lockScanRowback to summary
public boolean lockScanRow(OpenBTree open_btree, BTreeRowPosition pos, FetchDescriptor lock_fetch_desc, DataValueDescriptor[] lock_template, RowLocation lock_row_loc, boolean previous_key_lock, boolean forUpdate, int lock_operation) throws StandardException

Overrides org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow.

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

Lock a row as part of doing the scan.

Lock the row at the given slot (or the previous row if slot is 0).

If this routine returns true all locks were acquired while maintaining the latch on leaf. If this routine returns false, locks may or may not have been acquired, and the routine should be called again after the client has researched the tree to reget the latch on the appropriate page.

Parameters
open_btree:OpenBTree

The open_btree to associate latches with - used if routine has to scan backward.

pos:BTreeRowPosition

The position of the row to lock.

lock_template:DataValueDescriptor[]

A scratch area to use to read in rows.

previous_key_lock:boolean

Is this a previous key lock call?

forUpdate:boolean

Is the scan for update or for read only.

lock_operation:int

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.lockScanRow.

For what operation are we requesting the lock, this should be one of the following 4 options: LOCK_READ [read lock], (LOCK_INS | LOCK_UPD) [ lock for insert], (LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for previous key to insert], (LOCK_UPD) [lock for delete or replace]

Returns:boolean

Whether locks were acquired without releasing latch on leaf.

Exceptions
StandardException:
Standard exception policy.
unlockScanRecordAfterReadback to summary
public void unlockScanRecordAfterRead(BTreeRowPosition pos, boolean forUpdate) throws StandardException

Overrides org.apache.derby.impl.store.access.btree.index.B2IRowLocking2.unlockScanRecordAfterRead.

Implements org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.unlockScanRecordAfterRead.

Release read lock on a row. Because this is read uncommitted no S row locks will have been requested, thus none need be released. The only locks that need to be released are U locks requested if the scan was opened for update.

Parameters
pos:BTreeRowPosition

The position of the row to unlock.

forUpdate:boolean

Is the scan for update or for read only.

Exceptions
StandardException:

Doc from org.apache.derby.impl.store.access.btree.BTreeLockingPolicy.unlockScanRecordAfterRead.

Standard exception policy.