org.apache.derby.impl.store.access.btree.index
Class B2IRowLocking1

java.lang.Object
  extended by org.apache.derby.impl.store.access.btree.index.B2IRowLocking3
      extended by org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR
          extended by org.apache.derby.impl.store.access.btree.index.B2IRowLocking2
              extended by org.apache.derby.impl.store.access.btree.index.B2IRowLocking1
All Implemented Interfaces:
BTreeLockingPolicy

 class B2IRowLocking1
extends B2IRowLocking2
implements BTreeLockingPolicy

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.


Field Summary
 
Fields inherited from class org.apache.derby.impl.store.access.btree.index.B2IRowLocking3
base_cc, open_btree
 
Constructor Summary
B2IRowLocking1(Transaction rawtran, int lock_level, LockingPolicy locking_policy, ConglomerateController base_cc, OpenBTree open_btree)
          Constructors for This class:
 
Method Summary
 boolean lockScanRow(OpenBTree open_btree, BTree btree, BTreeRowPosition pos, FetchDescriptor lock_fetch_desc, DataValueDescriptor[] lock_template, RowLocation lock_row_loc, boolean previous_key_lock, boolean forUpdate, int lock_operation)
          Lock a row as part of doing the scan.
 void unlockScanRecordAfterRead(BTreeRowPosition pos, boolean forUpdate)
          Release read lock on a row.
 
Methods inherited from class org.apache.derby.impl.store.access.btree.index.B2IRowLocking3
_lockScanRow, lockNonScanPreviousRow, lockNonScanRow, lockNonScanRowOnPage, lockScanCommittedDeletedRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.derby.impl.store.access.btree.BTreeLockingPolicy
lockNonScanPreviousRow, lockNonScanRow, lockNonScanRowOnPage, lockScanCommittedDeletedRow
 

Constructor Detail

B2IRowLocking1

B2IRowLocking1(Transaction rawtran,
               int lock_level,
               LockingPolicy locking_policy,
               ConglomerateController base_cc,
               OpenBTree open_btree)
Constructors for This class:

Method Detail

lockScanRow

public boolean lockScanRow(OpenBTree open_btree,
                           BTree 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
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.

Specified by:
lockScanRow in interface BTreeLockingPolicy
Overrides:
lockScanRow in class B2IRowLockingRR
Parameters:
open_btree - The open_btree to associate latches with - used if routine has to scan backward.
btree - the conglomerate info.
pos - The position of the row to lock.
lock_template - A scratch area to use to read in rows.
previous_key_lock - Is this a previous key lock call?
forUpdate - Is the scan for update or for read only.
lock_operation - 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:
Whether locks were acquired without releasing latch on leaf.
Throws:
StandardException - Standard exception policy.

unlockScanRecordAfterRead

public void unlockScanRecordAfterRead(BTreeRowPosition pos,
                                      boolean forUpdate)
                               throws StandardException
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.

Specified by:
unlockScanRecordAfterRead in interface BTreeLockingPolicy
Overrides:
unlockScanRecordAfterRead in class B2IRowLocking2
Parameters:
pos - The position of the row to unlock.
forUpdate - Is the scan for update or for read only.
Throws:
StandardException - Standard exception policy.

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.