db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r496960 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/services/locks/ engine/org/apache/derby/iapi/store/raw/ engine/org/apache/derby/impl/services/locks/ engine/org/apache/derby/impl/store/access/btree/ engine/org/apache/der...
Date Wed, 17 Jan 2007 08:23:35 GMT
Author: kahatlen
Date: Wed Jan 17 00:23:32 2007
New Revision: 496960

URL: http://svn.apache.org/viewvc?view=rev&rev=496960
Log:
DERBY-2197: Remove unused code for locking rows while holding a latch

The patch makes the following changes to the engine code:

1) Removes LockFactory.lockObject(..., Latch) and its implementation in
   SinglePool.

2) Removes LockingPolicy.lockRecordForRead(Latch, ...) and
   LockingPolicy.lockRecordForWrite(Latch, ...) and all their
   implementations.

3) Removes Page.fetch(), Page.update() and Page.delete() and their
   implementations in BasePage.

4) The only caller of Page.update() (GenericScanController.replace())
   has been rewritten to use Page.updateAtSlot(), and an assert has
   been added to check whether row locking is needed.

5) The only caller of Page.delete() (BTreeScan.delete()) has been
   rewritten to use Page.deleteAtSlot(), and an assert has been added
   to check whether row locking is needed.

The unit tests for store and LockFactory have been updated so that
they don't use the removed methods.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/locks/LockFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/LockingPolicy.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Page.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/SinglePool.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/NoLocking.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking1.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2nohold.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3Escalate.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLockingRR.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_LockFactory.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverFullLog.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Recovery.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/locks/LockFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/locks/LockFactory.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/locks/LockFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/locks/LockFactory.java Wed Jan 17 00:23:32 2007
@@ -111,35 +111,6 @@
 	//	throws StandardException;
 
 	/**
-		Lock an object within a compatability space
-		and associate the lock with a group object,
-		In addition a held latch is passed in. If the lock
-		cannot be granted immediately, the latch will be released
-		and relatched after the lock is obtained. If the lock can be granted
-		immediately the latch is not released.
-		<BR>
-		The compatability space of the request is defined by the compatability
-		space of the latch.
-		<P>
-		@param group handle of group, must be private to a compatability space.
-		@param ref reference to object to be locked
-		@param qualifier A qualification of the request.
-		@param timeout amount of time to wait, <B>NO_WAIT is not supported</B>
-		@param latch latch to be atomically released/re-latched in a wait.
-
-		@return true if the latch was released, false otherwise.
-
-		@exception org.apache.derby.iapi.error.StandardException A deadlock has occured (message id will be LockFactory.Deadlock)
-		@exception org.apache.derby.iapi.error.StandardException Another thread interupted this thread while
-		it was waiting for the lock. This will be a StandardException with a nested java.lang.InterruptedException exception,
-		(message id will be LockFactory.InterruptedExceptionId)
-		@exception StandardException Standard Cloudscape error policy.
-
-	*/
-	public boolean lockObject(Object group, Lockable ref, Object qualifier, int timeout, Latch latch)
-		throws StandardException;
-
-	/**
 		Unlock a single lock on a single object held within this compatability space
 		that was locked with the supplied qualifier.
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/LockingPolicy.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/LockingPolicy.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/LockingPolicy.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/LockingPolicy.java Wed Jan 17 00:23:32 2007
@@ -21,8 +21,6 @@
 
 package org.apache.derby.iapi.store.raw;
 
-import org.apache.derby.iapi.services.locks.Latch;
-
 import org.apache.derby.iapi.error.StandardException;
 
 /**
@@ -135,26 +133,6 @@
     boolean         forUpdate)
 		throws StandardException;
 
-
-	/**
-		Lock a record while holding a page latch.
-
-        @param latch        Latch held.
-        @param record       Record to lock.
-        @param forUpdate    Should container be locked for update, or read?
-
-
-		@exception StandardException	Standard Cloudscape error policy
-
-		@see Page
-
-	*/
-	public void lockRecordForRead(
-		Latch			latch, 
-		RecordHandle    record, 
-		boolean         forUpdate)
-			throws StandardException;
-
 	/**
         Request a write lock which will be released immediately upon grant.
 
@@ -204,21 +182,6 @@
     boolean         waitForLock)
 		throws StandardException;
 
-	/**
-	    Lock a record for write while holding a page latch.
-
-
-        @param latch        Page latch held.
-        @param record       Record to lock.
-
-		@exception StandardException	Standard Cloudscape error policy
-
-		@see Page
-	*/
-	public void lockRecordForWrite(
-    Latch			latch, 
-    RecordHandle    record)
-		throws StandardException;
 	/**
 		Called after a record has been fetched.
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Page.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Page.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Page.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/Page.java Wed Jan 17 00:23:32 2007
@@ -196,45 +196,6 @@
 		 throws StandardException;
 
     /**
-     * Fetch and lock a non-deleted record.
-     * <p>
-     * Lock and fetch a non-deleted record identified by a RecordHandle.  
-     * Reads data from the page into row.
-     * <P>
-     * <B>Locking Policy</B>
-     * <BR>
-     * Calls the lockRecordForRead() method of the LockingPolicy object
-     * passed to the openContainer() call before the record is accessed.
-     * <BR>
-     * The page latch may be released and re-latched within this method.
-     * This will occur if the record lock has to be waited for.
-     *
-     * @param handle        Handle to record.
-     * @param row           Row to be filled in with data from the record.
-     * @param validColumns  a bit map of which columns in the row is to be 
-     *                      fetched.  ValidColumns will not be changed by 
-     *                      RawStore.
-     * @param forUpdate     true if the intention is to update this record, 
-     *                      false otherwise.
-     *
-     * @return A handle to the record, null if the record has been deleted.
-     *
-     * @exception StandardException	Standard Cloudscape error policy, 
-     *                              a statemente level exception is thrown if
-     *                              the record handle does not match a record 
-     *                              on the page.
-     *
-     * @see Page#delete
-     * @see LockingPolicy
-     **/
-	RecordHandle fetch(
-    RecordHandle        handle, 
-    Object[]            row, 
-    FormatableBitSet    validColumns, 
-    boolean             forUpdate)
-		throws StandardException;
-
-    /**
      * Is it likely that an insert will fit on this page?
      * <p>
      * Return true if there is a good chance an insert will fit on this page, 
@@ -316,77 +277,6 @@
     FormatableBitSet    validColumns,
     byte                insertFlag, 
     int                 overflowThreshold)
-		throws StandardException;
-
-    /**
-     * Update the record identified by the record handle.
-     * <p>
-     * Update the record, the new column values are found in row[] and if
-     * validColumns is not-null, only use the columns indicated as valid in
-     * the bit set.
-     * <p>
-     * <BR>
-     * The page latch may be released and re-latched within this method.
-     * This will occur if the record lock has to be waited for.
-     *
-     * @param handle        the record handle
-     * @param row           The row version of the data
-     * @param validColumns  A bit map of which columns in the row is valid.  
-     *                      ValidColumns will not be changed by RawStore.
-     *
-     * @return true if the record is updated.  
-     *         False if it is not because the record is already deleted.
-     *
-     * @exception StandardException	Standard Cloudscape error policy
-     * @exception StandardException The container was not opened in update mode.
-     * @exception StandardException If the record handle does not match 
-     *                              a record on the page.
-     *
-     * @see Page#updateAtSlot
-     *
-	 * @exception  StandardException  Standard exception policy.
-     **/
-	boolean update(
-    RecordHandle        handle, 
-    Object[]            row, 
-    FormatableBitSet                 validColumns)
-		throws StandardException;
-
-    /**
-     * Mark the record identified by position as deleted.
-     * <p>
-     * Mark the record identified by position as deleted. The record may be 
-     * undeleted sometime later using undelete() by any transaction that sees 
-     * the record.
-     * <p>
-     * <B>Locking Policy</B>
-     * <P>
-     * Calls the lockRecordForWrite() method of the LockingPolicy object
-     * passed to the openContainer() call before the record is deleted.
-     *
-     * <BR>
-     * The page latch may be released and re-latched within this method.
-     * This will occur if the record lock has to be waited for.
-     *
-     * @param handle    record Handle to record
-     * @param undo      if logical undo may be necessary, a function pointer to
-     *                  the access code where the logical undo logic resides.
-     *                  Null if logical undo is not necessary.
-     *
-     * @return true if the record was updated.  
-     *         False if it wasn't because it is already deleted.
-     *
-     * @exception StandardException	Standard Cloudscape error policy
-     * @exception StandardException The container was not opened in update mode.
-     * @exception StandardException If the record handle does not match 
-     *                              a record on the page.
-     *
-     * @see Page#deleteAtSlot
-     * @see LockingPolicy
-     **/
-	public boolean delete(
-    RecordHandle    handle, 
-    LogicalUndo     undo)
 		throws StandardException;
 
     /**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java Wed Jan 17 00:23:32 2007
@@ -121,7 +121,8 @@
 	 *	@exception	StandardException Standard Cloudscape policy.
 
 	*/
-	public Lock lockObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout, Latch latch)
+	public Lock lockObject(Object compatabilitySpace, Lockable ref,
+						   Object qualifier, int timeout)
 		throws StandardException
 	{		
 		if (SanityManager.DEBUG) {
@@ -204,11 +205,6 @@
 				return null;
 			}
 
-			// this is where we need to release the latch
-			if (latch != null)
-				unlock(latch, 1);
-
-
 		} // synchronized block
 
 		boolean deadlockWait = false;
@@ -306,19 +302,6 @@
                             nextWaitingLock = 
                                 control.getNextWaiter(waitingLock, true, this);
 
-                            // this is where we need to re-obtain the latch, 
-                            // it's safe to call this lockObject() which will 
-                            // get the synchronization we already hold, because
-                            // java allows nested synchronization and it will 
-                            // be released automatically if we have to wait
-
-                            if (latch != null) {
-                                lockObject(
-                                    compatabilitySpace, latch.getLockable(), 
-                                    latch.getQualifier(), 
-                                    C_LockFactory.WAIT_FOREVER,
-                                    (Latch) null);
-                            }
                             return waitingLock;
                         }
 
@@ -363,17 +346,6 @@
                         // If we were not woken by another then we have
                         // timed out. Either deadlock out or timeout
                         if (willQuitWait) {
-
-                            // Even if we deadlocked trying to get the lock, 
-                            // still reget the latch so that client's need not
-                            // know latch was released.
-
-                            if (latch != null) {
-                                lockObject(
-                                    compatabilitySpace, latch.getLockable(), 
-                                    latch.getQualifier(), 
-                                    C_LockFactory.WAIT_FOREVER, (Latch) null);
-                            }
 
                             if (SanityManager.DEBUG) 
                             {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/SinglePool.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/SinglePool.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/SinglePool.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/SinglePool.java Wed Jan 17 00:23:32 2007
@@ -119,7 +119,8 @@
 	public boolean latchObject(Object compatabilitySpace, Lockable ref, Object qualifier, int timeout) 
 		throws StandardException {
 
-		Lock latch = lockTable.lockObject(compatabilitySpace, ref, qualifier, timeout, (Latch) null);
+		Lock latch = lockTable.lockObject(compatabilitySpace, ref, qualifier,
+										  timeout);
 
 		if (SanityManager.DEBUG) {
 			if (latch == null)
@@ -150,7 +151,8 @@
 
 		@see LockFactory#lockObject
 	*/
-	protected Lock lockAnObject(Object compatabilitySpace, Object group, Lockable ref, Object qualifier, int timeout, Latch heldLatch)
+	protected Lock lockAnObject(Object compatabilitySpace, Object group,
+								Lockable ref, Object qualifier, int timeout)
 			throws StandardException
 	{
 		if (SanityManager.DEBUG) {
@@ -173,7 +175,7 @@
 		}
 
 		Lock lock = 
-            lockTable.lockObject(compatabilitySpace, ref, qualifier, timeout, heldLatch);
+            lockTable.lockObject(compatabilitySpace, ref, qualifier, timeout);
 
 		// See if NO_WAIT was passed in and the lock could not be granted.
 		if (lock == null) {
@@ -224,29 +226,10 @@
 	public boolean lockObject(Object compatabilitySpace, Object group, Lockable ref, Object qualifier, int timeout)
 		throws StandardException {
 
-		return lockAnObject(compatabilitySpace, group, ref, qualifier, timeout, (Latch) null) != null;
-	}
-
-	/**
-		Lock a specific object while holding a latch
-
-		<BR>
-		MT - thread safe
-
-		@exception StandardException Standard Cloudscape error policy
-
-		@see LockFactory#lockObject
-	*/
-	public boolean lockObject(Object group, Lockable ref, Object qualifier, int timeout, Latch latch)
-		throws StandardException {
-
-		if (SanityManager.DEBUG) {
-			if (timeout == C_LockFactory.NO_WAIT)
-				SanityManager.THROWASSERT("no wait lock requested in lockObject() with latch");
-		}
+		Lock lock =
+			lockAnObject(compatabilitySpace, group, ref, qualifier, timeout);
 
-		Lock lock = lockAnObject(latch.getCompatabilitySpace(), group, ref, qualifier, timeout, latch);
-		return lock instanceof ActiveLock;
+		return lock != null;
 	}
 
 	/**
@@ -457,7 +440,7 @@
 		}
 
 		Lock lock = 
-            lockTable.lockObject(compatabilitySpace, ref, qualifier, timeout, (Latch) null);
+            lockTable.lockObject(compatabilitySpace, ref, qualifier, timeout);
 
 		if (SanityManager.DEBUG) {
 			if (SanityManager.DEBUG_ON(Constants.LOCK_TRACE)) {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java Wed Jan 17 00:23:32 2007
@@ -1361,17 +1361,24 @@
                 }
             }
 
+            if (SanityManager.DEBUG) {
+                // DERBY-2197: Assume no row locking here. If locking policy
+                // requires row locking, we would need to obtain a row lock at
+                // this point.
+                SanityManager.ASSERT(
+                    (container.getLockingPolicy().getMode() !=
+                         LockingPolicy.MODE_RECORD),
+                    "Locking policy requires row locking.");
+            }
 
-            // Do a fetch just to get the RecordHandle for the delete call,
-            // don't fetch any columns.
-            RecordHandle delete_rh = 
-                scan_position.current_leaf.page.fetchFromSlot(
-                    (RecordHandle) null, scan_position.current_slot, 
-                    RowUtil.EMPTY_ROW, (FetchDescriptor) null, true);
-
-            ret_val =
-                scan_position.current_leaf.page.delete(
-                    delete_rh, this.btree_undo);
+            if (scan_position.current_leaf.page.isDeletedAtSlot(
+                    scan_position.current_slot)) {
+                ret_val = false;
+            } else {
+                scan_position.current_leaf.page.deleteAtSlot(
+                    scan_position.current_slot, true, this.btree_undo);
+                ret_val = true;
+            }
 
             // See if we just deleted the last row on the page, in a btree a
             // page with all rows still has 1 left - the control row.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericScanController.java Wed Jan 17 00:23:32 2007
@@ -42,6 +42,7 @@
 
 import org.apache.derby.iapi.store.raw.ContainerHandle;
 import org.apache.derby.iapi.store.raw.FetchDescriptor;
+import org.apache.derby.iapi.store.raw.LockingPolicy;
 import org.apache.derby.iapi.store.raw.Page;
 import org.apache.derby.iapi.store.raw.RecordHandle;
 import org.apache.derby.iapi.store.raw.Transaction;
@@ -1361,9 +1362,36 @@
 	{
         repositionScanForUpateOper();
 
-        boolean ret_val = 
-            scan_position.current_page.update(
-                scan_position.current_rh, row, validColumns);
+        Page page = scan_position.current_page;
+        int slot = scan_position.current_slot;
+
+        if (SanityManager.DEBUG) {
+            // DERBY-2197: Previously, we would try to get an exclusive row
+            // lock here when the container was opened in row locking mode. In
+            // most cases, the container is not opened in row locking mode. If
+            // it is, and the open conglomerate uses update locks,
+            // repositionScanForUpateOper() has already obtained an exclusive
+            // row lock. We don't expect this method to be called unless these
+            // conditions are satisfied, so now we just assert that no row
+            // locking is required at this point.
+            SanityManager.ASSERT(
+                ((open_conglom.getContainer().getLockingPolicy().getMode() !=
+                      LockingPolicy.MODE_RECORD) ||
+                          (open_conglom.isUseUpdateLocks())),
+                "Current mode of container requires row locking.");
+
+            // make sure current_rh and current_slot are in sync
+            SanityManager.ASSERT(
+                slot == page.getSlotNumber(scan_position.current_rh));
+        }
+
+        boolean ret_val;
+        if (page.isDeletedAtSlot(slot)) {
+            ret_val = false;
+        } else {
+            page.updateAtSlot(slot, row, validColumns);
+            ret_val = true;
+        }
 
         scan_position.unlatch();
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java Wed Jan 17 00:23:32 2007
@@ -397,61 +397,6 @@
 				(ignoreDelete || !isDeletedAtSlot(slot)));
 	}
 
-	/**
-		<OL>
-		<LI>Lock the record (according to the locking policy)
-		<LI>If the record is deleted then return null. We must check after we hold the lock to
-		ensure that we don't look at the delete status of an uncommitted record.
-		<LI>Fetch the record
-		<LI>Unlock the record (according to the locking policy)
-		</OL>
-
-		@see Page#fetch
-
-		@exception StandardException messageId equals StandardException.newException(SQLState.RECORD_VANISHED
-		If the record identfied by handle does not exist on this page.
-
-		@exception StandardException	Standard Cloudscape error policy
-		@exception StandardException   record is not on page with message id equal to
-			StandardException.newException(SQLState.RECORD_VANISHED.
-	*/
-
-	public RecordHandle fetch(
-    RecordHandle        handle, 
-    Object[]            row, 
-    FormatableBitSet    validColumns, 
-    boolean             forUpdate)
-	throws StandardException {
-
-		if (SanityManager.DEBUG) {
-			SanityManager.ASSERT(isLatched());
-		}
-
-		owner.getLockingPolicy().lockRecordForRead(myLatch, handle, forUpdate);
-
-		// See if the record is deleted or not.
-		int slot = getSlotNumber(handle);
-
-        StoredRecordHeader recordHeader = getHeaderAtSlot(slot);
-
-		if (recordHeader.isDeleted())
-			return null;
-
-        FetchDescriptor hack_fetch = 
-            new FetchDescriptor(
-                    row.length, validColumns, (Qualifier[][]) null);
-
-		// magic to copy rows across ...
-		restoreRecordFromSlot(
-            slot, row, hack_fetch, handle, recordHeader, true);
-
-		owner.getLockingPolicy().unlockRecordAfterRead(
-                owner.getTransaction(), owner, handle, forUpdate, true);
-
-		return handle;
-	}
-
-
 	public RecordHandle fetchFromSlot(
     RecordHandle            rh, 
     int                     slot, 
@@ -1017,59 +962,6 @@
 
 	protected abstract BasePage getNewOverflowPage()
 		throws StandardException;
-
-	public final boolean update(
-    RecordHandle            handle, 
-    Object[]   row, 
-    FormatableBitSet                 validColumns)
-		throws StandardException
-	{
-		if (SanityManager.DEBUG) {
-			SanityManager.ASSERT(isLatched());
-		}
-
-		if (!owner.updateOK())
-        {
-			throw StandardException.newException(
-                    SQLState.DATA_CONTAINER_READ_ONLY);
-        }
-
-		RawTransaction t = owner.getTransaction();
-
-		owner.getLockingPolicy().lockRecordForWrite(myLatch, handle);
-
-		int slot = getSlotNumber(handle);
-
-		if (isDeletedAtSlot(slot))
-			return false;
-
-		doUpdateAtSlot(t, slot, handle.getId(), row, validColumns);
-		
-		return true;
-	}
-
-
-	/** @see Page#delete
-	    @see BasePage#deleteAtSlot
-		@exception StandardException Standard exception policy. 
-	*/
-	public boolean delete(RecordHandle handle, LogicalUndo undo)
-		throws StandardException
-	{
-		if (SanityManager.DEBUG) {
-			SanityManager.ASSERT(isLatched());
-		}
-
-		owner.getLockingPolicy().lockRecordForWrite(myLatch, handle);
-
-		int slot = getSlotNumber(handle);
-
-		if (isDeletedAtSlot(slot))
-			return false;
-
-		deleteAtSlot(slot, true, undo);
-		return true;
-	}
 
 	/** @see Page#updateAtSlot
 		@exception StandardException	Standard Cloudscape error policy

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/NoLocking.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/NoLocking.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/NoLocking.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/NoLocking.java Wed Jan 17 00:23:32 2007
@@ -21,8 +21,6 @@
 
 package org.apache.derby.impl.store.raw.xact;
 
-import org.apache.derby.iapi.services.locks.Latch;
-
 import org.apache.derby.iapi.store.raw.LockingPolicy;
 import org.apache.derby.iapi.store.raw.ContainerHandle;
 import org.apache.derby.iapi.store.raw.RecordHandle;
@@ -67,14 +65,6 @@
 		return true;
 	}
 
-	public void lockRecordForRead(
-    Latch			latch, 
-    RecordHandle    record, 
-    boolean         forUpdate)
-		throws StandardException
-	{
-	}
-
 	public boolean zeroDurationLockRecordForWrite(
     Transaction     t, 
     RecordHandle    record,
@@ -93,13 +83,6 @@
 		throws StandardException
 	{
 		return true;
-	}
-
-	public void lockRecordForWrite(
-    Latch			latch, 
-    RecordHandle    record)
-		throws StandardException
-	{
 	}
 
 	public void unlockRecordAfterRead(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking1.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking1.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking1.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking1.java Wed Jan 17 00:23:32 2007
@@ -22,8 +22,6 @@
 package org.apache.derby.impl.store.raw.xact;
 
 import org.apache.derby.iapi.services.locks.LockFactory;
-import org.apache.derby.iapi.services.locks.C_LockFactory;
-import org.apache.derby.iapi.services.locks.Latch;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
@@ -102,29 +100,6 @@
                 true : 
                 super.lockRecordForRead(
                     t, container_handle, record, waitForLock, forUpdate));
-	}
-
-    /**
-     * Obtain lock on record being read while holding a latch.
-     * <p>
-     * Assumes that a table level IS has been acquired.  Will acquire a Shared
-     * or Update lock on the row, depending on the "forUpdate" parameter.
-     * <p>
-     *
-     * @param latch         The latch being held.
-     * @param record        The record to be locked.
-     * @param forUpdate     Whether to open for read or write access.
-     *
-	 * @exception  StandardException  Standard exception policy.
-     **/
-	public void lockRecordForRead(
-    Latch			latch, 
-    RecordHandle    record, 
-    boolean         forUpdate)
-		throws StandardException
-	{
-        if (forUpdate)
-            super.lockRecordForRead(latch, record, forUpdate);
 	}
 
 	public void unlockRecordAfterRead(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2.java Wed Jan 17 00:23:32 2007
@@ -23,7 +23,6 @@
 
 import org.apache.derby.iapi.services.locks.LockFactory;
 import org.apache.derby.iapi.services.locks.C_LockFactory;
-import org.apache.derby.iapi.services.locks.Latch;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
@@ -171,36 +170,6 @@
                 qualifier,
                 waitForLock ? 
                     C_LockFactory.TIMED_WAIT : C_LockFactory.NO_WAIT));
-	}
-
-    /**
-     * Obtain lock on record being read while holding a latch.
-     * <p>
-     * Assumes that a table level IS has been acquired.  Will acquire a Shared
-     * or Update lock on the row, depending on the "forUpdate" parameter.
-     * <p>
-     *
-     * @param latch         The latch being held.
-     * @param record        The record to be locked.
-     * @param forUpdate     Whether to open for read or write access.
-     *
-	 * @exception  StandardException  Standard exception policy.
-     **/
-	public void lockRecordForRead(
-    Latch			latch, 
-    RecordHandle    record, 
-    boolean         forUpdate)
-		throws StandardException
-	{
-        // RESOLVE - Did I do the right thing with the "forUpdate" variable.
-        // RESOLVE (mikem) - looks like it needs work for update locks, and
-        //     compatibility spaces.
-
-		Object qualifier = forUpdate ? RowLock.RU2 : RowLock.RS2;
-
-        lf.lockObject(
-            record.getContainerId(), record, qualifier, 
-            C_LockFactory.TIMED_WAIT, latch);
 	}
 
 	public void unlockRecordAfterRead(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2nohold.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2nohold.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2nohold.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking2nohold.java Wed Jan 17 00:23:32 2007
@@ -23,7 +23,6 @@
 
 import org.apache.derby.iapi.services.locks.LockFactory;
 import org.apache.derby.iapi.services.locks.C_LockFactory;
-import org.apache.derby.iapi.services.locks.Latch;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3.java Wed Jan 17 00:23:32 2007
@@ -23,7 +23,6 @@
 
 import org.apache.derby.iapi.services.locks.LockFactory;
 import org.apache.derby.iapi.services.locks.C_LockFactory;
-import org.apache.derby.iapi.services.locks.Latch;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
@@ -193,35 +192,6 @@
 	}
 
     /**
-     * Obtain lock on record being read while holding a latch.
-     * <p>
-     * Assumes that a table level IS has been acquired.  Will acquire a Shared
-     * or Update lock on the row, depending on the "forUpdate" parameter.
-     * <p>
-     *
-     * @param latch         The latch being held.
-     * @param record        The record to be locked.
-     * @param forUpdate     Whether to open for read or write access.
-     *
-	 * @exception  StandardException  Standard exception policy.
-     **/
-	public void lockRecordForRead(
-    Latch			latch, 
-    RecordHandle    record, 
-    boolean         forUpdate)
-		throws StandardException
-	{
-        // RESOLVE - Did I do the right thing with the "forUpdate" variable.
-
-        // For now just lock the row in Shared mode.
-		Object qualifier = forUpdate ? getUpdateLockType() : getReadLockType();
-
-        lf.lockObject(
-            latch.getCompatabilitySpace(), record, qualifier, 
-            C_LockFactory.TIMED_WAIT, latch);
-	}
-
-    /**
      * Obtain lock on record being written.
      * <p>
      * Assumes that a table level IX has been acquired.  Will acquire an
@@ -279,31 +249,6 @@
             t.getCompatibilitySpace(), t, record, 
             lockForInsert ? RowLock.RI : getWriteLockType(),
             waitForLock   ? C_LockFactory.TIMED_WAIT : C_LockFactory.NO_WAIT));
-	}
-
-    /**
-     * Obtain lock on record being written while holding a latch.
-     * <p>
-     * Assumes that a table level IX has been acquired.  Will acquire an
-     * Exclusive (X) lock on the row.
-     * <p>
-     *
-     * @param latch         The latch being held
-     * @param record        The record to be locked.
-     *
-	 * @exception  StandardException  Standard exception policy.
-     **/
-	public void lockRecordForWrite(
-    Latch		    latch, 
-    RecordHandle    record)
-		throws StandardException
-	{
-        lf.lockObject(
-            latch.getCompatabilitySpace(), 
-            record, 
-            getWriteLockType(),
-            C_LockFactory.TIMED_WAIT, 
-            latch);
 	}
 
 	public int getMode() {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3Escalate.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3Escalate.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3Escalate.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLocking3Escalate.java Wed Jan 17 00:23:32 2007
@@ -22,7 +22,6 @@
 package org.apache.derby.impl.store.raw.xact;
 
 import org.apache.derby.iapi.services.locks.LockFactory;
-import org.apache.derby.iapi.services.locks.Latch;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLockingRR.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLockingRR.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLockingRR.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/RowLockingRR.java Wed Jan 17 00:23:32 2007
@@ -21,8 +21,6 @@
 package org.apache.derby.impl.store.raw.xact;
 
 import org.apache.derby.iapi.services.locks.LockFactory;
-import org.apache.derby.iapi.services.locks.C_LockFactory;
-import org.apache.derby.iapi.services.locks.Latch;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_LockFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_LockFactory.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_LockFactory.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/services/T_LockFactory.java Wed Jan 17 00:23:32 2007
@@ -505,6 +505,10 @@
 		Create two compatability spaces and ensure that locks/latches
 		block each other out.
 
+		This test case originally tested that latches were released when a row
+		lock couldn't be obtained immediately, but LockFactory doesn't have
+		that functionality any more after DERBY-2197.
+
 		@exception StandardException	An exception thrown by a method of LockFactory
 		@exception T_Fail	Some behaviour of the LockFactory is incorrect
 	*/
@@ -524,19 +528,17 @@
 
 		// Simulate a page/row lock type access
 		lf.latchObject(cs0, page, null, C_LockFactory.WAIT_FOREVER);
-		lf.lockObject(g0, rA, null, C_LockFactory.WAIT_FOREVER, page.latch);		// would release the latch if it had to wait
+		lf.lockObject(cs0, g0, rA, null, C_LockFactory.WAIT_FOREVER);
 		lf.unlatch(page.latch);
 
 		lf.latchObject(cs1, page, null, C_LockFactory.WAIT_FOREVER);
-		lf.lockObject(g1, rB, null, C_LockFactory.WAIT_FOREVER, page.latch);		// would release the latch if it had to wait
+		lf.lockObject(cs1, g1, rB, null, C_LockFactory.WAIT_FOREVER);
 
 		checkLockCount(cs0, 1);
 		checkLockCount(cs1, 2);
 
-		// this wait should release the latch, while waiting
-        // on lock, but then re-get the latch after the timeout.
 		try {
-			lf.lockObject(g1, rA, null, 5000, page.latch);
+			lf.lockObject(cs1, g1, rA, null, 5000);
 			throw T_Fail.testFailMsg("lock succeeded on already locked object");
 		}
 		catch (StandardException lfe) {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java Wed Jan 17 00:23:32 2007
@@ -297,8 +297,6 @@
 		// Page tests
 		P001(0);
 		P002(0);
-		P003(0);
-		P004(0);
 		P005(0);
 		P006();
 		P007(0);
@@ -351,7 +349,6 @@
 
 		P050(); // rollback tests
 		P051();
-		P052();
 		P053();
 		P054();
         P055(0);
@@ -395,8 +392,6 @@
 		C012(ContainerHandle.TEMPORARY_SEGMENT);
 		//P001(ContainerHandle.TEMPORARY_SEGMENT);
 		//P002(ContainerHandle.TEMPORARY_SEGMENT);
-		P003(ContainerHandle.TEMPORARY_SEGMENT);
-		P004(ContainerHandle.TEMPORARY_SEGMENT);
 		P005(ContainerHandle.TEMPORARY_SEGMENT);
 		P011(ContainerHandle.TEMPORARY_SEGMENT);
 		P012(ContainerHandle.TEMPORARY_SEGMENT);
@@ -1235,9 +1230,10 @@
 		t_util.t_checkFetch(lastPage, rh002, REC_002);
 		t_util.t_checkFetch(lastPage, rh003, REC_003);
 
-		lastPage.delete(rh001, (LogicalUndo)null);
-		if (lastPage.fetch(
-              rh001, new DataValueDescriptor[0], (FormatableBitSet) null, false) != null)
+		int slot1 = lastPage.getSlotNumber(rh001);
+		lastPage.deleteAtSlot(slot1, true, null);
+		if (lastPage.fetchFromSlot(
+				rh001, slot1, new DataValueDescriptor[0], null, false) != null)
         {
 			throw T_Fail.testFailMsg("deleted record is still present");
         }
@@ -1248,9 +1244,10 @@
 		t_util.t_checkFetchNext(lastPage, rh002, REC_003);
 		t_util.t_checkFetchPrevious(lastPage, rh003, REC_002);
 
-		lastPage.delete(rh002, (LogicalUndo)null);
-		if (lastPage.fetch(
-              rh002, new DataValueDescriptor[0], (FormatableBitSet) null, false) != null)
+		int slot2 = lastPage.getSlotNumber(rh002);
+		lastPage.deleteAtSlot(slot2, true, null);
+		if (lastPage.fetchFromSlot(
+				rh002, slot2, new DataValueDescriptor[0], null, false) != null)
         {
 			throw T_Fail.testFailMsg("deleted record is still present");
         }
@@ -1277,14 +1274,9 @@
 
 		T_RawStoreRow urow = new T_RawStoreRow(REC_004);
 
-		if (lastPage.fetch(
-              rh003, new DataValueDescriptor[0], (FormatableBitSet) null, true) == null)
-        {
-			throw T_Fail.testFailMsg("fetch for update returned false");
-        }
-	
-		if (!lastPage.update(rh003, urow.getRow(), (FormatableBitSet) null))
-			throw T_Fail.testFailMsg("update returned false");
+		int slot3 = lastPage.getSlotNumber(rh003);
+		if (lastPage.updateAtSlot(slot3, urow.getRow(), null) == null)
+			throw T_Fail.testFailMsg("updateAtSlot returned null");
 
 		// Order is 003
 		t_util.t_checkFetch(lastPage, rh003, REC_004);
@@ -1718,144 +1710,6 @@
 		PASS("P002");
 	}
 
-	/**
-		Test Page.delete
-
-		@exception T_Fail Unexpected behaviour from the API
-		@exception StandardException Unexpected exception from the implementation
-
-		@see Page#delete
-	*/
-
-	protected void P003(long segment) throws StandardException, T_Fail {
-
-		Transaction t = t_util.t_startTransaction();		
-
-		long cid = t_util.t_addContainer(t, segment);
-
-		ContainerHandle c = t_util.t_openContainer(t, segment, cid, true);
-		Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER);
-
-		RecordHandle r1, r2;
-
-		T_RawStoreRow row1 = new T_RawStoreRow(REC_001);
-		T_RawStoreRow row2 = new T_RawStoreRow(REC_002);
-
-		r1 = t_util.t_insertAtSlot(page, 0, row1);
-		r2 = t_util.t_insertAtSlot(page, 1, row2);
-
-		t_util.t_checkFetch(page, r1, REC_001);
-		if (r2 != null)
-			t_util.t_checkFetch(page, r2, REC_002);
-
-		t_util.t_checkRecordCount(page, 2, r2 == null ? 1 : 2);
-
-		// delete the first
-		if (!page.delete(r1, (LogicalUndo)null))
-			throw T_Fail.testFailMsg("delete() returned false");
-
-		t_util.t_checkRecordCount(page, 2, r2 == null ? 0 : 1);
-
-		if (page.delete(r1, (LogicalUndo)null))
-			throw T_Fail.testFailMsg("delete() returned true on already deleted record");
-
-		t_util.t_checkRecordCount(page, 2, r2 == null ? 0 : 1);
-
-		if (page.recordExists(r1, false))
-			throw T_Fail.testFailMsg("recordExists() returned true for deleted record");
-
-		// check the other record is still there
-		if (r2 != null)
-			t_util.t_checkFetch(page, r2, REC_002);
-
-
-		if (!page.isDeletedAtSlot(0))
-			throw T_Fail.testFailMsg("isDeletedAtSlot() doesn't represent correct state");
-
-		t_util.t_dropContainer(t, segment, cid);	// cleanup
-
-		t_util.t_commit(t);
-		t.close();
-
-		PASS("P003");
-	}
-
-	/**
-		Test Page.update
-
-		@exception T_Fail Unexpected behaviour from the API
-		@exception StandardException Unexpected exception from the implementation
-
-		@see Page#update
-	*/
-	protected void P004(long segment) throws StandardException, T_Fail {
-
-		Transaction t = t_util.t_startTransaction();		
-
-		long cid = t_util.t_addContainer(t, segment);
-
-		ContainerHandle c = t_util.t_openContainer(t, segment, cid, true);
-		Page page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER);
-
-		RecordHandle r1, r2;
-
-		T_RawStoreRow row1 = new T_RawStoreRow(REC_001);
-		T_RawStoreRow row2 = new T_RawStoreRow(REC_002);
-
-		r1 = t_util.t_insertAtSlot(page, 0, row1);
-		r2 = t_util.t_insertAtSlot(page, 1, row2);
-
-		t_util.t_checkFetch(page, r1, REC_001);
-		if (r2 != null)
-			t_util.t_checkFetch(page, r2, REC_002);
-
-		row1 = new T_RawStoreRow((String) null);
-		if (!page.update(r1, row1.getRow(), (FormatableBitSet) null))
-			throw T_Fail.testFailMsg("update() returned false");
-
-		t_util.t_checkFetch(page, r1, (String) null);
-		if (r2 != null)
-			t_util.t_checkFetch(page, r2, REC_002);
-
-		t_util.t_checkFetch(page, r1, (String) null);
-		if (r2 != null)
-			t_util.t_checkFetch(page, r2, REC_002);
-
-		row1 = new T_RawStoreRow(REC_003);
-		if (!page.update(r1, row1.getRow(), (FormatableBitSet) null))
-			throw T_Fail.testFailMsg("update() returned false");
-
-		t_util.t_checkFetch(page, r1, REC_003);
-		if (r2 != null)
-			t_util.t_checkFetch(page, r2, REC_002);
-
-		// now delete the record we have been updating
-		if (!page.delete(r1, (LogicalUndo)null))
-			throw T_Fail.testFailMsg("delete returned false");
-
-		row1 = new T_RawStoreRow(REC_004);
-		if (page.update(r1, row1.getRow(), (FormatableBitSet) null))
-			throw T_Fail.testFailMsg("update returned true on deleted record");
-
-		page.deleteAtSlot(0, false, (LogicalUndo)null);
-
-		t_util.t_checkFetch(page, r1, REC_003);
-
-		if (!page.update(r1, row1.getRow(), (FormatableBitSet) null))
-			throw T_Fail.testFailMsg("update returned false");
-
-		t_util.t_checkFetch(page, r1, REC_004);
-
-
-		t_util.t_dropContainer(t, segment, cid);	// cleanup
-
-		t_util.t_commit(t);
-		t.close();
-
-		PASS("P004");
-
-	}
-
 	/* test repeated insert */
 	protected void P005(long segment) throws StandardException, T_Fail 
 	{
@@ -1972,20 +1826,22 @@
 			throw T_Fail.testFailMsg("failed pdate should not change time stamp");
 
 		T_RawStoreRow row2 = new T_RawStoreRow(REC_002);
-		page1.update(rh, row2.getRow(), (FormatableBitSet) null);
+		int slot2 = page1.getSlotNumber(rh);
+		page1.updateAtSlot(slot2, row2.getRow(), null);
 		if (page1.equalTimeStamp(ts))
 			throw T_Fail.testFailMsg("timestamp on page not changed after update operation");
 
 		page1.setTimeStamp(ts);
 
 		T_RawStoreRow upd1 = new T_RawStoreRow(REC_003);
-		page1.update(rh, upd1.getRow(), BS_COL_0);
+		int slot = page1.getSlotNumber(rh);
+		page1.updateAtSlot(slot, upd1.getRow(), BS_COL_0);
 		if (page1.equalTimeStamp(ts))
 			throw T_Fail.testFailMsg("timestamp on page not changed after update field operation");
 
 		page1.setTimeStamp(ts);
 
-		page1.delete(rh, (LogicalUndo)null);
+		page1.deleteAtSlot(slot, true, null);
 		if (page1.equalTimeStamp(ts))
 			throw T_Fail.testFailMsg("timestamp on page not changed after delete operation");
 
@@ -3064,7 +2920,7 @@
 			if ((i % 3) == 1)
 			{
 				deleted++;
-				page1.delete(rh, (LogicalUndo)null);
+				page1.deleteAtSlot(i, true, null);
 			}
 		}
 
@@ -3237,8 +3093,9 @@
 
 			try 
 			{
-				page1.fetch(
-                    rhs[i], new DataValueDescriptor[0], (FormatableBitSet) null, true);
+				int slot = page1.getSlotNumber(rhs[i]);
+				page1.fetchFromSlot(
+					rhs[i], slot, new DataValueDescriptor[0], null, false);
 				throw T_Fail.testFailMsg("fetched an invalid record " + rhs[i]);
 			}
 			catch (StandardException se)
@@ -3248,7 +3105,8 @@
 
 			try 
 			{
-				page1.update(rhs[i], row1.getRow(), (FormatableBitSet) null);
+				int slot = page1.getSlotNumber(rhs[i]);
+				page1.updateAtSlot(slot, row1.getRow(), null);
 				throw T_Fail.testFailMsg("updated an invalid record " + rhs[i]);
 			}
 			catch (StandardException se)
@@ -3258,7 +3116,8 @@
 
 			try 
 			{
-				page1.update(rhs[i], row1.getRow(), BS_COL_0);
+				int slot = page1.getSlotNumber(rhs[i]);
+				page1.updateAtSlot(slot, row1.getRow(), BS_COL_0);
 				throw T_Fail.testFailMsg("updated an invalid record field");
 			}
 			catch (StandardException se)
@@ -3268,7 +3127,8 @@
 
 			try 
 			{
-				page1.delete(rhs[i], null);
+				int slot = page1.getSlotNumber(rhs[i]);
+				page1.deleteAtSlot(slot, true, null);
 				throw T_Fail.testFailMsg("delete an invalid record " + rhs[i]);
 			}
 			catch (StandardException se)
@@ -4770,7 +4630,8 @@
 			c = t_util.t_openContainer(t, segment, cid, true);
 
 			page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER);
-			page.update(rh1, bigRow.getRow(), (FormatableBitSet)null);
+			int slot1 = page.getSlotNumber(rh1);
+			page.updateAtSlot(slot1, bigRow.getRow(), null);
 			t_util.t_checkFetch(page, rh1, bigRow);
 			page.unlatch();
 			page = null;
@@ -4808,7 +4669,8 @@
 
 			page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER);
 
-			page.update(rh2, partialRow.getRow(), colList);
+			int slot2 = page.getSlotNumber(rh2);
+			page.updateAtSlot(slot2, partialRow.getRow(), colList);
 
 			bigRow.setColumn(1, 8000, REC_006);
 			t_util.t_checkFetch(page, rh2, bigRow);
@@ -4843,7 +4705,8 @@
 
 			c = t_util.t_openContainer(t, segment, cid, true);
 			page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER);
-			page.update(rh3, bigRow.getRow(), (FormatableBitSet)null);
+			int slot3 = page.getSlotNumber(rh3);
+			page.updateAtSlot(slot3, bigRow.getRow(), null);
 			t_util.t_checkFetch(page, rh3, bigRow);
 			page.unlatch();
 			page = null;
@@ -4960,11 +4823,13 @@
 
 			FormatableBitSet colList = new FormatableBitSet(2);
 			colList.set(1);		// update first row column 1, the second column
-			page.update(rh1, partialRow.getRow(), colList);
+			int slot1 = page.getSlotNumber(rh1);
+			page.updateAtSlot(slot1, partialRow.getRow(), colList);
 
 			colList.clear(1);
 			colList.set(0);		// update second row column 0, the first column
-			page.update(rh2, partialRow2.getRow(), colList);
+			int slot2 = page.getSlotNumber(rh2);
+			page.updateAtSlot(slot2, partialRow2.getRow(), colList);
 
 			// verify the update worked.
 			row1.setColumn(1, 400, REC_004);
@@ -5067,7 +4932,8 @@
 			r2.setColumn(4, 500, REC_006);
 			r2.setColumn(5, 500, REC_005);
 
-			page.update(rh1, r2.getRow(), (FormatableBitSet)null);
+			int slot1 = page.getSlotNumber(rh1);
+			page.updateAtSlot(slot1, r2.getRow(), null);
 			t_util.t_checkFetch(page, rh1, r2);
 
 			page.unlatch();
@@ -5088,7 +4954,8 @@
 			
 			t.setSavePoint(SP1, null);
 
-			page.update(rh1, r1.getRow(), (FormatableBitSet)null);
+			slot1 = page.getSlotNumber(rh1);
+			page.updateAtSlot(slot1, r1.getRow(), null);
 			t_util.t_checkFetch(page, rh1, r1);
 			page.unlatch();
 			page = null;
@@ -5170,7 +5037,8 @@
 
 			T_RawStoreRow bigRow = new T_RawStoreRow(1);
 			bigRow.setColumn(0, 6400, REC_001);
-			page.update(rh1, bigRow.getRow(), (FormatableBitSet)null);
+			int slot1 = page.getSlotNumber(rh1);
+			page.updateAtSlot(slot1, bigRow.getRow(), null);
 			t_util.t_checkFetch(page,rh1, bigRow);
 			page.unlatch();
 			page = null;
@@ -5210,7 +5078,8 @@
 			page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER);
 
 			t.setSavePoint(SP1, null);
-			page.update(rh1, row2.getRow(), (FormatableBitSet)null);
+			slot1 = page.getSlotNumber(rh1);
+			page.updateAtSlot(slot1, row2.getRow(), null);
 
 			nextPage = t_util.t_addPage(c);
 			nextPageNumber = nextPage.getPageNumber();
@@ -5237,7 +5106,8 @@
 			t_util.t_checkFetch(page, rh1, smallRow);
 
 			// update row so that it has overflow rows and long columns
-			page.update(rh1, row2.getRow(), (FormatableBitSet)null);
+			slot1 = page.getSlotNumber(rh1);
+			page.updateAtSlot(slot1, row2.getRow(), null);
 
 			// remember the next page
 			nextPage = t_util.t_addPage(c);
@@ -5256,7 +5126,8 @@
 			
 			c = t_util.t_openContainer(t, segment, cid, true);
 			page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER);
-			page.update(rh1, row3.getRow(), (FormatableBitSet)null);
+			slot1 = page.getSlotNumber(rh1);
+			page.updateAtSlot(slot1, row3.getRow(), null);
 			t_util.t_checkFetch(page, rh1, row3);
 			page.unlatch();
 			page = null;
@@ -5394,57 +5265,6 @@
 		t_util.t_commit(t);
 		t.close();
 	}
-	/**
-		Test rollback of Page.delete
-		@exception T_Fail Unexpected behaviour from the API
-		@exception StandardException Unexpected exception from the implementation
-
-		@see Page#delete
-
-	*/
-	protected void P052()
-		 throws StandardException, T_Fail
-	{
-		if (!testRollback)
-			return;
-
-		Transaction t = t_util.t_startTransaction();
-
-		long cid = t_util.t_addContainer(t,0);
-		t_util.t_commit(t);
-
-		ContainerHandle c = t_util.t_openContainer(t, 0, cid, true);
-
-		// first insert two rows
-		T_RawStoreRow row = new T_RawStoreRow(REC_001);
-		RecordHandle rh1 = t_util.t_insert(c, row);
-		row = new T_RawStoreRow(REC_002);
-		RecordHandle rh2 = t_util.t_insert(c, row);
-
-		t_util.t_commit(t);
-
-		c = t_util.t_openContainer(t, 0, cid, true);
-
-		t_util.t_checkFetch(c, rh1, REC_001);
-		t_util.t_checkFetch(c, rh2, REC_002);
-
-		t_util.t_delete(c, rh2);
-
-		t_util.t_checkFetch(c, rh1, REC_001);
-
-		t_util.t_abort(t);
-
-		c = t_util.t_openContainer(t, 0, cid, true);
-		t_util.t_checkFetch(c, rh1, REC_001);
-		t_util.t_checkFetch(c, rh2, REC_002);
-
-		PASS("P052");
-
-		t_util.t_dropContainer(t, 0, cid);	// cleanup
-
-		t_util.t_commit(t);
-		t.close();
-	}
 
 	/**
 		Test insertAtSlot that rolls back with a purge
@@ -6096,7 +5916,8 @@
 				row.setColumn(j, 256, "XX" + j + "YY");
 			}
 
-			page.update(rh, row.getRow(), (FormatableBitSet) null);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, row.getRow(), null);
 			page.unlatch();
 			page = t_util.t_getPage(c, ContainerHandle.FIRST_PAGE_NUMBER);
 
@@ -6155,7 +5976,8 @@
 			T_RawStoreRow rowU = new T_RawStoreRow(i+1);
 			rowU.setColumn(i, 256, "XX" + i + "YY");
 
-			page.update(rh, rowU.getRow(), colList);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, rowU.getRow(), colList);
 			page.unlatch();
 
 			T_RawStoreRow rowF = new T_RawStoreRow(i+1);
@@ -6257,7 +6079,8 @@
 		colList.set(1);
 		row.setColumn(0, REC_004);
 		row.setColumn(1, REC_003);
-		page.update(rh, row.getRow(), colList);
+		int slot = page.getSlotNumber(rh);
+		page.updateAtSlot(slot, row.getRow(), colList);
 		t_util.t_checkFetch(page, rh, row);
 
 
@@ -6291,7 +6114,8 @@
 		} else {
 			colNum = 0; // only used for read from now on
 		}
-		page.update(rh, rowU.getRow(), colList);
+		int slot = page.getSlotNumber(rh);
+		page.updateAtSlot(slot, rowU.getRow(), colList);
 
 		T_RawStoreRow row = new T_RawStoreRow(2);
 		row.setColumn(colNum, newVal);
@@ -6343,7 +6167,8 @@
 			T_RawStoreRow rowU = new T_RawStoreRow(i+1);
 			rowU.setColumn(i, 400, "WW" + i + "UU");
 
-			page.update(rh, rowU.getRow(), colList);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, rowU.getRow(), colList);
 			page.unlatch();
 
 			row.setColumn(i, 400, "WW" + i + "UU");
@@ -6406,7 +6231,8 @@
 			T_RawStoreRow rowU = new T_RawStoreRow(i+1);
 			rowU.setColumn(i, 400, "WW" + i + "UU");
 
-			page.update(rh, rowU.getRow(), colList);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, rowU.getRow(), colList);
 			page.unlatch();
 
 			row.setColumn(i, 400, "WW" + i + "UU");
@@ -6475,7 +6301,8 @@
 			T_RawStoreRow rowU = new T_RawStoreRow(i+1);
 			rowU.setColumn(i, 3000, "WW" + i + "UU"); // longer than 4096 page length
 
-			page.update(rh, rowU.getRow(), colList);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, rowU.getRow(), colList);
 			page.unlatch();
 
 			row.setColumn(i, 3000, "WW" + i + "UU");
@@ -6500,7 +6327,8 @@
 			T_RawStoreRow rowU = new T_RawStoreRow(i+1);
 			rowU.setColumn(i, (String) null);
 
-			page.update(rh, rowU.getRow(), colList);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, rowU.getRow(), colList);
 			page.unlatch();
 
 			row.setColumn(i, (String) null);
@@ -6614,7 +6442,8 @@
 			T_RawStoreRow rowU = new T_RawStoreRow(i+1);
 			rowU.setColumn(i, 3000, "WW" + i + "UU"); // longer than 4096 page length
 
-			page.update(rh, rowU.getRow(), colList);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, rowU.getRow(), colList);
 		}
 
 		t_util.t_abort(t);
@@ -7252,7 +7081,8 @@
 
 			c = t_util.t_openContainer(longtran, 0, cid, true);
 			Page p2 = t_util.t_getPage(c, r2.getPageNumber());
-			p2.update(r2, row5.getRow(), (FormatableBitSet) null);
+			int slot2 = p2.getSlotNumber(r2);
+			p2.updateAtSlot(slot2, row5.getRow(), null);
 			p2.unlatch();
 
 
@@ -7279,7 +7109,8 @@
 			t_util.t_commit(t2);
 			c2 = t_util.t_openContainer(t2, 0, cid2, true);
 			Page p5 = t_util.t_getPage(c2, r5.getPageNumber());
-			p5.update(r5, row5.getRow(), (FormatableBitSet) null);
+			int slot5 = p5.getSlotNumber(r5);
+			p5.updateAtSlot(slot5, row5.getRow(), null);
 			p5.unlatch();
 
 			//		cpm = contextService.newContextManager();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java Wed Jan 17 00:23:32 2007
@@ -513,7 +513,8 @@
 			
 			logFactory.flushAll();
 
-			page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, bigrow.getRow(), null);
 
 			if(checksumTest)
 				simulateLogFileCorruption();
@@ -647,7 +648,8 @@
 			}
 
 			logFactory.flushAll();
-			page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, bigrow.getRow(), null);
 			
 			if(checksumTest)
 				simulateLogFileCorruption();
@@ -817,7 +819,8 @@
 				for (j = 0; j < numpages; j++)
 				{
 					t[i].switchTransactionContext();
-					page[i][j].update(rh[i][j], row2.getRow(), (FormatableBitSet) null);
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row2.getRow(), null);
 					t[i].resetContext();
 				}
 
@@ -835,8 +838,10 @@
 			//////////////////////// step 3 ////////////////////////
 			T_RawStoreRow row3 = new T_RawStoreRow(REC_003);
 			for (i = 0; i < numtrans; i++)
-				for (j = 0; j < numpages; j++)
-					page[i][j].update(rh[i][j], row3.getRow(), (FormatableBitSet) null);
+				for (j = 0; j < numpages; j++) {
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row3.getRow(), null);
+				}
 
 			for (i = 0; i < numtrans; i++)
 				t[i].setSavePoint(SP2, null);	// sp2
@@ -847,8 +852,10 @@
 			{
 				t[i].switchTransactionContext();
 
-				for (j = 0; j < numpages; j++)
-					page[i][j].update(rh[i][j], row4.getRow(), (FormatableBitSet) null);
+				for (j = 0; j < numpages; j++) {
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row4.getRow(), null);
+				}
 				t[i].resetContext();
 			}
 
@@ -893,8 +900,10 @@
 			for (i = 0; i < numtrans; i++)
 			{
 				t[i].switchTransactionContext();
-				for (j = 0; j < numpages; j++)
-					page[i][j].update(rh[i][j], row5.getRow(), (FormatableBitSet) null);
+				for (j = 0; j < numpages; j++) {
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row5.getRow(), null);
+				}
 				t[i].resetContext();
 			}
 
@@ -939,8 +948,10 @@
 			for (i = 0; i < numtrans; i++)
 			{
 				t[i].switchTransactionContext();
-				for (j = 0; j < numpages; j++)
-					page[i][j].update(rh[i][j], row6.getRow(), (FormatableBitSet) null); // step 8
+				for (j = 0; j < numpages; j++) {
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row6.getRow(), null);
+				}
 				t[i].resetContext();
 			}
 
@@ -1272,7 +1283,8 @@
 			}
 
 			logFactory.flushAll();
-			page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, bigrow.getRow(), null);
 
 			if(checksumTest)
 				simulateLogFileCorruption();
@@ -1413,7 +1425,8 @@
 			}
 			logFactory.flushAll();
 
-			page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, bigrow.getRow(), null);
 
 			if(checksumTest)
 				simulateLogFileCorruption();
@@ -1551,7 +1564,8 @@
 				System.setProperty(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString((1997/2) + 16));
 			}
 			logFactory.flushAll();
-			page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, bigrow.getRow(), null);
 
 			if(checksumTest)
 				simulateLogFileCorruption();
@@ -1690,7 +1704,8 @@
 				System.setProperty(LogToFile.TEST_LOG_PARTIAL_LOG_WRITE_NUM_BYTES, Integer.toString(1997+15));
 			}
 			logFactory.flushAll();
-			page.update(rh, bigrow.getRow(), (FormatableBitSet) null);
+			int slot = page.getSlotNumber(rh);
+			page.updateAtSlot(slot, bigrow.getRow(), null);
 
 			if(checksumTest)
 				simulateLogFileCorruption();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverFullLog.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverFullLog.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverFullLog.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverFullLog.java Wed Jan 17 00:23:32 2007
@@ -462,7 +462,8 @@
 			for (j = 0; j < numpages; j++)
 			{
 				t[i].switchTransactionContext();
-				page[i][j].update(rh[i][j], row2.getRow(), (FormatableBitSet) null);
+				int slot = page[i][j].getSlotNumber(rh[i][j]);
+				page[i][j].updateAtSlot(slot, row2.getRow(), null);
 				t[i].resetContext();
 			}
 
@@ -474,8 +475,10 @@
 		//////////////////////// step 3 ////////////////////////
 		T_RawStoreRow row3 = new T_RawStoreRow(REC_003);
 		for (i = 0; i < numtrans; i++)
-			for (j = 0; j < numpages; j++)
-				page[i][j].update(rh[i][j], row3.getRow(), (FormatableBitSet) null);
+			for (j = 0; j < numpages; j++) {
+				int slot = page[i][j].getSlotNumber(rh[i][j]);
+				page[i][j].updateAtSlot(slot, row3.getRow(), null);
+			}
 
 		for (i = 0; i < numtrans; i++)
 			t[i].setSavePoint(SP2, null);	// sp2
@@ -486,8 +489,10 @@
 		{
 			t[i].switchTransactionContext();
 
-			for (j = 0; j < numpages; j++)
-				page[i][j].update(rh[i][j], row4.getRow(), (FormatableBitSet) null);
+			for (j = 0; j < numpages; j++) {
+				int slot = page[i][j].getSlotNumber(rh[i][j]);
+				page[i][j].updateAtSlot(slot, row4.getRow(), null);
+			}
 			t[i].resetContext();
 		}
 
@@ -527,8 +532,10 @@
 		for (i = 0; i < numtrans; i++)
 		{
 			t[i].switchTransactionContext();
-			for (j = 0; j < numpages; j++)
-				page[i][j].update(rh[i][j], row5.getRow(), (FormatableBitSet) null);
+			for (j = 0; j < numpages; j++) {
+				int slot = page[i][j].getSlotNumber(rh[i][j]);
+				page[i][j].updateAtSlot(slot, row5.getRow(), null);
+			}
 			t[i].resetContext();
 		}
 
@@ -568,8 +575,10 @@
 		for (i = 0; i < numtrans; i++)
 		{
 			t[i].switchTransactionContext();
-			for (j = 0; j < numpages; j++)
-				page[i][j].update(rh[i][j], row6.getRow(), (FormatableBitSet) null); // step 8
+			for (j = 0; j < numpages; j++) {
+				int slot = page[i][j].getSlotNumber(rh[i][j]);
+				page[i][j].updateAtSlot(slot, row6.getRow(), null);
+			}
 			t[i].resetContext();
 		}
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Recovery.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Recovery.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Recovery.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Recovery.java Wed Jan 17 00:23:32 2007
@@ -838,15 +838,14 @@
 			// slot 0
 			RecordHandle r2 = t_util.t_insertAtSlot(page, 0, row2);
 			if (r2 != null) {
-				page.delete(r2, (LogicalUndo)null);
+				page.deleteAtSlot(0, true, null);
 			}
 
 			// slot 1
 			RecordHandle r3 = (r2 == null) ? r2 : t_util.t_insertAtSlot(page, 1, row3);
 			if (r3 != null)
 			{
-			
-				page.delete(r3, (LogicalUndo)null);
+				page.deleteAtSlot(1, true, null);
 			}
 
 			// slot 2
@@ -1509,7 +1508,8 @@
                         row2.getRow(), 
                         (FetchDescriptor) null, 
                         true);
-				p.update(rh, big.getRow(), (FormatableBitSet) null);
+				int slot = p.getSlotNumber(rh);
+				p.updateAtSlot(slot, big.getRow(), null);
 				p.unlatch();
 			}
 
@@ -2036,18 +2036,24 @@
 			t2.resetContext();
 
 			t1.switchTransactionContext();
-			p10.update(r10, row2.getRow(), (FormatableBitSet) null);
-			p11.update(r11, row2.getRow(), (FormatableBitSet) null);
+			int slot10 = p10.getSlotNumber(r10);
+			p10.updateAtSlot(slot10, row2.getRow(), null);
+			int slot11 = p11.getSlotNumber(r11);
+			p11.updateAtSlot(slot11, row2.getRow(), null);
 			t1.resetContext();
 
 			t2.switchTransactionContext();
-			p20.update(r20, row2.getRow(), (FormatableBitSet) null);
-			p21.update(r21, row2.getRow(), (FormatableBitSet) null);
+			int slot20 = p20.getSlotNumber(r20);
+			p20.updateAtSlot(slot20, row2.getRow(), null);
+			int slot21 = p21.getSlotNumber(r21);
+			p21.updateAtSlot(slot21, row2.getRow(), null);
 			t2.resetContext();
 		
 			t1.switchTransactionContext();
-			p10.update(r10, rowP.getRow(), BS_COL_0);
-			p11.update(r11, rowP.getRow(), BS_COL_0);
+			slot10 = p10.getSlotNumber(r10);
+			p10.updateAtSlot(slot10, rowP.getRow(), BS_COL_0);
+			slot11 = p11.getSlotNumber(r11);
+			p11.updateAtSlot(slot11, rowP.getRow(), BS_COL_0);
 			p10.unlatch();
 			p11.unlatch();
 			t1.resetContext();
@@ -2055,10 +2061,12 @@
 
 
 			t2.switchTransactionContext();
-			p20.update(r20, rowP.getRow(), BS_COL_0);
-			p21.update(r21, rowP.getRow(), BS_COL_0);
+			slot20 = p20.getSlotNumber(r20);
+			p20.updateAtSlot(slot20, rowP.getRow(), BS_COL_0);
+			slot21 = p21.getSlotNumber(r21);
+			p21.updateAtSlot(slot21, rowP.getRow(), BS_COL_0);
 
-			p21.delete(r21, (LogicalUndo)null);
+			p21.deleteAtSlot(slot21, true, null);
 			p20.unlatch();
 			p21.unlatch();
 			t2.resetContext();
@@ -2180,7 +2188,8 @@
 			////////////////////////////////////////////////////////////////
 			t.setSavePoint(SP2, null);
 
-			page.update(r0, row5.getRow(), (FormatableBitSet) null);
+			int slot0 = page.getSlotNumber(r0);
+			page.updateAtSlot(slot0, row5.getRow(), null);
 			page.deleteAtSlot(1, true, (LogicalUndo)null);
 
 			t_util.t_checkRecordCount(page, 3, 2);
@@ -2199,7 +2208,8 @@
 
 			// after a rollback to sp, do some more changes
 
-			page.update(r0, row5.getRow(), (FormatableBitSet) null);
+			slot0 = page.getSlotNumber(r0);
+			page.updateAtSlot(slot0, row5.getRow(), null);
 			page.deleteAtSlot(0, true, (LogicalUndo)null);
 			page.deleteAtSlot(1, true, (LogicalUndo)null);
 			page.deleteAtSlot(2, true, (LogicalUndo)null);
@@ -2436,26 +2446,34 @@
 			t2.resetContext();
 
 			t1.switchTransactionContext();
-			p10.update(r10, row2.getRow(), (FormatableBitSet) null);
-			p11.update(r11, row2.getRow(), (FormatableBitSet) null);
+			int slot10 = p10.getSlotNumber(r10);
+			p10.updateAtSlot(slot10, row2.getRow(), null);
+			int slot11 = p11.getSlotNumber(r11);
+			p11.updateAtSlot(slot11, row2.getRow(), null);
 			t1.resetContext();
 
 			t2.switchTransactionContext();
-			p20.update(r20, row2.getRow(), (FormatableBitSet) null);
-			p21.update(r21, row2.getRow(), (FormatableBitSet) null);
+			int slot20 = p20.getSlotNumber(r20);
+			p20.updateAtSlot(slot20, row2.getRow(), null);
+			int slot21 = p21.getSlotNumber(r21);
+			p21.updateAtSlot(slot21, row2.getRow(), null);
 			t2.resetContext();
 
 
 			t1.switchTransactionContext();
-			p10.update(r10, rowP.getRow(), BS_COL_0);
-			p11.update(r11, rowP.getRow(), BS_COL_0);
+			slot10 = p10.getSlotNumber(r10);
+			p10.updateAtSlot(slot10, rowP.getRow(), BS_COL_0);
+			slot11 = p11.getSlotNumber(r11);
+			p11.updateAtSlot(slot11, rowP.getRow(), BS_COL_0);
 			t1.resetContext();
 
 			t2.switchTransactionContext();
-			p20.update(r20, rowP.getRow(), BS_COL_0);
-			p21.update(r21, rowP.getRow(), BS_COL_0);
+			slot20 = p20.getSlotNumber(r20);
+			p20.updateAtSlot(slot20, rowP.getRow(), BS_COL_0);
+			slot21 = p21.getSlotNumber(r21);
+			p21.updateAtSlot(slot21, rowP.getRow(), BS_COL_0);
 
-			p21.delete(r21, (LogicalUndo)null);
+			p21.deleteAtSlot(slot21, true, null);
 			t2.resetContext();
 
 			REPORT("setup S201: container1 " + cid10 + " container2 " + cid11 + 
@@ -2570,7 +2588,8 @@
 			/////////////////////////////////////////////////////
 			t.setSavePoint(SP1, null);
 
-			page.update(r0, row5.getRow(), (FormatableBitSet) null);
+			int slot0 = page.getSlotNumber(r0);
+			page.updateAtSlot(slot0, row5.getRow(), null);
 			t_util.t_checkFetchBySlot(page, 0, REC_005, false, false);
 			t_util.t_checkFetchBySlot(page, 1, REC_002, false, false);
 
@@ -2608,7 +2627,8 @@
 			////////////////////////////////////////////////////////////////
 			t.setSavePoint(SP2, null);
 
-			page.update(r0, row5.getRow(), (FormatableBitSet) null);
+			slot0 = page.getSlotNumber(r0);
+			page.updateAtSlot(slot0, row5.getRow(), null);
 			page.deleteAtSlot(1, true, (LogicalUndo)null);
 
 			t_util.t_checkRecordCount(page, 3, 2);
@@ -2627,7 +2647,8 @@
 
 		// after a rollback to sp, do some more changes
 
-			page.update(r0, row5.getRow(), (FormatableBitSet) null);
+			slot0 = page.getSlotNumber(r0);
+			page.updateAtSlot(slot0, row5.getRow(), null);
 			page.deleteAtSlot(0, true, (LogicalUndo)null);
 			page.deleteAtSlot(1, true, (LogicalUndo)null);
 			page.deleteAtSlot(2, true, (LogicalUndo)null);
@@ -2815,7 +2836,8 @@
 				for (j = 0; j < numpages; j++)
 				{
 					t[i].switchTransactionContext();
-					page[i][j].update(rh[i][j], row2.getRow(), (FormatableBitSet) null);
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row2.getRow(), null);
 					t[i].resetContext();
 				}
 
@@ -2829,8 +2851,10 @@
 			//////////////////////// step 3 ////////////////////////
 			T_RawStoreRow row3 = new T_RawStoreRow(REC_003);
 			for (i = 0; i < numtrans; i++)
-				for (j = 0; j < numpages; j++)
-					page[i][j].update(rh[i][j], row3.getRow(), (FormatableBitSet) null);
+				for (j = 0; j < numpages; j++) {
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row3.getRow(), null);
+				}
 
 			for (i = 0; i < numtrans; i++)
 				t[i].setSavePoint(SP2, null);	// sp2
@@ -2841,8 +2865,10 @@
 			{
 				t[i].switchTransactionContext();
 
-				for (j = 0; j < numpages; j++)
-					page[i][j].update(rh[i][j], row4.getRow(), (FormatableBitSet) null);
+				for (j = 0; j < numpages; j++) {
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row4.getRow(), null);
+				}
 				t[i].resetContext();
 			}
 
@@ -2882,8 +2908,10 @@
 			for (i = 0; i < numtrans; i++)
 			{
 				t[i].switchTransactionContext();
-				for (j = 0; j < numpages; j++)
-					page[i][j].update(rh[i][j], row5.getRow(), (FormatableBitSet) null);
+				for (j = 0; j < numpages; j++) {
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row5.getRow(), null);
+				}
 				t[i].resetContext();
 			}
 
@@ -2922,8 +2950,10 @@
 			for (i = 0; i < numtrans; i++)
 			{
 				t[i].switchTransactionContext();
-				for (j = 0; j < numpages; j++)
-					page[i][j].update(rh[i][j], row6.getRow(), (FormatableBitSet) null); // step 8
+				for (j = 0; j < numpages; j++) {
+					int slot = page[i][j].getSlotNumber(rh[i][j]);
+					page[i][j].updateAtSlot(slot, row6.getRow(), null);
+				}
 				t[i].resetContext();
 			}
 
@@ -3589,7 +3619,8 @@
 			RecordHandle r5 = (r4 == null) ? r4 : t_util.t_insertAtSlot(page, 4, row5);
 			if (r5 != null)
 			{
-				page.delete(r5, (LogicalUndo)null);
+				int slot = page.getSlotNumber(r5);
+				page.deleteAtSlot(slot, true, null);
 			}
 
 			t_util.t_commit(t);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java?view=diff&rev=496960&r1=496959&r2=496960
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_Util.java Wed Jan 17 00:23:32 2007
@@ -241,7 +241,7 @@
 		@exception StandardException Unexpected exception from the implementation
 
 		@see Page#recordExists
-		@see Page#fetch
+		@see Page#fetchFromSlot
 	*/
 	public void t_checkFetchDeleted(ContainerHandle c, RecordHandle rh, 
 									String data)
@@ -291,7 +291,8 @@
 		for (int i = 0; i < ncol; i++)
 			readRow.setColumn(i, (String) null);
 
-		RecordHandle rhf = page.fetch(rh, readRow.getRow(), (FormatableBitSet) null, false);
+		RecordHandle rhf = page.fetchFromSlot(rh, page.getSlotNumber(rh),
+											  readRow.getRow(), null, false);
 		if (rhf == null)
 			throw T_Fail.testFailMsg("Failed to read record");
 		if (!readRow.toString().equals(row.toString()))
@@ -318,8 +319,10 @@
 			readRow.setColumn(i, (String) null);
 		FormatableBitSet colList = new FormatableBitSet(numCols);
 		colList.set(colNum);
+		FetchDescriptor desc = new FetchDescriptor(numCols, colList, null);
 
-		RecordHandle rhf = page.fetch(rh, readRow.getRow(), colList, false);
+		RecordHandle rhf = page.fetchFromSlot(rh, page.getSlotNumber(rh),
+											  readRow.getRow(), desc, false);
 		if (rhf == null)
 			throw T_Fail.testFailMsg("Failed to read record");
 		String col = readRow.getStorableColumn(colNum).toString();
@@ -1248,7 +1251,7 @@
 		@exception T_Fail Record handle returned is null.
 		@exception StandardException Unexpected exception from the implementation
 
-		@see Page#update
+		@see Page#updateAtSlot
 	*/
 	public void t_update(ContainerHandle c, RecordHandle rh, T_RawStoreRow row)
 		 throws T_Fail, StandardException
@@ -1256,7 +1259,8 @@
 		Page page = t_getPage(c, rh.getPageNumber());
 		try
 		{
-			if (!page.update(rh, row.getRow(), (FormatableBitSet)null))
+			int slot = page.getSlotNumber(rh);
+			if (page.updateAtSlot(slot, row.getRow(), null) == null)
 				throw T_Fail.testFailMsg("update failed");
 
 			t_checkFetch(page, rh, row);
@@ -1276,7 +1280,7 @@
 		@exception T_Fail Record handle returned is null.
 		@exception StandardException Unexpected exception from the implementation
 
-		@see Page#update
+		@see Page#updateAtSlot
 	*/
 	public void t_checkUpdateCol(Page page, RecordHandle rh, int colNum, int
 								 numCols, String data)
@@ -1292,42 +1296,11 @@
 		FormatableBitSet colList = new FormatableBitSet(numCols);
 		colList.set(colNum);
 
-		if (!page.update(rh, writeRow.getRow(), colList))
+		int slot = page.getSlotNumber(rh);
+		if (page.updateAtSlot(slot, writeRow.getRow(), colList) == null)
 			throw T_Fail.testFailMsg("update failed");
 		
 		t_checkFetchCol(page, rh, colNum, numCols, data);
-	}
-
-        
-
-	/**
-		Delete a record.
-
-		@exception T_Fail Record handle returned is null.
-		@exception StandardException Unexpected exception from the implementation
-
-		@see Page#delete
-	*/
-	public void t_delete(ContainerHandle c, RecordHandle rh)
-		throws T_Fail, StandardException {
-
-		Page page = t_getPage(c, rh.getPageNumber());
-
-		try
-		{
-			if (!page.recordExists(rh, false))
-				throw T_Fail.testFailMsg("record does not exist");
-
-			if (!page.delete(rh, (LogicalUndo)null))
-				throw T_Fail.testFailMsg("delete failed");
-
-			if (page.recordExists(rh, false))
-				throw T_Fail.testFailMsg("recordExists() returns true after a delete");
-		}
-		finally
-		{
-			page.unlatch();
-		}
 	}
 
 	/**



Mime
View raw message