db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1028712 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate: GenericConglomerateController.java GenericScanController.java OpenConglomerate.java
Date Fri, 29 Oct 2010 12:16:53 GMT
Author: kahatlen
Date: Fri Oct 29 12:16:52 2010
New Revision: 1028712

URL: http://svn.apache.org/viewvc?rev=1028712&view=rev
Log:
DERBY-4685: Dead/unreachable code in OpenConglomerate.lockPositionForWrite()

Remove the second parameter (forInsert) in lockPositionForWrite()
because it is always false in the current code, and because the method
is not believed to work for inserts.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericConglomerateController.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/access/conglomerate/OpenConglomerate.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericConglomerateController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericConglomerateController.java?rev=1028712&r1=1028711&r2=1028712&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericConglomerateController.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/GenericConglomerateController.java
Fri Oct 29 12:16:52 2010
@@ -176,7 +176,7 @@ public abstract class GenericConglomerat
             return false;
         }
 
-        open_conglom.lockPositionForWrite(pos, false /* not an insert */, true);
+        open_conglom.lockPositionForWrite(pos, true);
 
         boolean ret_val = true;
 
@@ -275,8 +275,7 @@ public abstract class GenericConglomerat
 
         if (open_conglom.isForUpdate())
         {
-            open_conglom.lockPositionForWrite(
-                pos, false /* not an insert */, true);
+            open_conglom.lockPositionForWrite(pos, true);
         }
         else
         {
@@ -380,8 +379,7 @@ public abstract class GenericConglomerat
 
         if (open_conglom.isForUpdate())
         {
-            open_conglom.lockPositionForWrite(
-                pos, false /* not an insert */, waitForLock);
+            open_conglom.lockPositionForWrite(pos, waitForLock);
         }
         else
         {
@@ -474,7 +472,7 @@ public abstract class GenericConglomerat
             return false;
         }
 
-        open_conglom.lockPositionForWrite(pos, false, true);
+        open_conglom.lockPositionForWrite(pos, true);
 
         boolean ret_val = true;
 

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?rev=1028712&r1=1028711&r2=1028712&view=diff
==============================================================================
--- 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
Fri Oct 29 12:16:52 2010
@@ -257,8 +257,7 @@ public abstract class GenericScanControl
             // scan positioned on the row, need to request an
             // X lock before we can actually perform the delete
 
-            open_conglom.lockPositionForWrite(
-                scan_position, false /* not insert */, true);
+            open_conglom.lockPositionForWrite(scan_position, true);
         }
     }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java?rev=1028712&r1=1028711&r2=1028712&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/OpenConglomerate.java
Fri Oct 29 12:16:52 2010
@@ -521,7 +521,6 @@ public abstract class OpenConglomerate
      */
     public boolean lockPositionForWrite(
     RowPosition pos,
-    boolean     forInsert,
     boolean     waitForLock)
         throws StandardException
     {
@@ -563,6 +562,10 @@ public abstract class OpenConglomerate
         if (SanityManager.DEBUG)
             SanityManager.ASSERT(pos.current_rh != null);
 
+        // This method is only used for locking existing rows, never for
+        // insert operations.
+        final boolean forInsert = false;
+
         boolean lock_granted_with_latch_held =
             this.container.getLockingPolicy().
                 lockRecordForWrite(



Mime
View raw message