db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r634101 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java
Date Thu, 06 Mar 2008 01:07:40 GMT
Author: mikem
Date: Wed Mar  5 17:07:39 2008
New Revision: 634101

URL: http://svn.apache.org/viewvc?rev=634101&view=rev
Log:
DERBY-3362

Changed code to use right interface to get the control row and return null
if either page does not exist or if the background thread would have had to
wait for the page.  In either case post commit just skips processing.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java?rev=634101&r1=634100&r2=634101&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreePostCommit.java
Wed Mar  5 17:07:39 2008
@@ -454,16 +454,18 @@
     OpenBTree           open_btree)
         throws StandardException
     {
-        ControlRow  controlRow              = null; 
+        LeafControlRow leaf = null;
 
         try
         {
-
-            if ((controlRow = ControlRow.get(open_btree, page_number)) == null)
+            // The following can fail, returning null, either if it can't get
+            // the latch or somehow the page requested no longer exists.  In 
+            // either case the post commit work will just skip it.
+            leaf = (LeafControlRow) 
+                ControlRow.getNoWait(open_btree, page_number);
+            if (leaf == null)
                 return;
 
-            LeafControlRow leaf = (LeafControlRow) controlRow;
-
             BTreeLockingPolicy  btree_locking_policy = 
                 open_btree.getLockingPolicy();
 
@@ -517,8 +519,8 @@
         }
         finally
         {
-            if (controlRow != null)
-                controlRow.release();
+            if (leaf != null)
+                leaf.release();
         }
     }
 }



Mime
View raw message