db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r532636 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/store/raw/data/BasePage.java testing/org/apache/derbyTesting/unitTests/store/T_Util.java
Date Thu, 26 Apr 2007 07:20:05 GMT
Author: kahatlen
Date: Thu Apr 26 00:20:04 2007
New Revision: 532636

URL: http://svn.apache.org/viewvc?view=rev&rev=532636
Log:
DERBY-2107: Move page latching out of the lock manager

Added assert which throws error on attempts to latch the same page twice.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.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/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=532636&r1=532635&r2=532636
==============================================================================
--- 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 Thu
Apr 26 00:20:04 2007
@@ -1563,6 +1563,11 @@
 
 				// just deadlock out if a transaction tries to double latch the
 				// page while not in abort
+
+				if (SanityManager.DEBUG) {
+					SanityManager.THROWASSERT("Attempted to latch page twice");
+				}
+
 			}
 
 			while (owner != null) {

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=532636&r1=532635&r2=532636
==============================================================================
--- 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 Thu
Apr 26 00:20:04 2007
@@ -35,6 +35,7 @@
 import org.apache.derby.iapi.services.context.ContextManager;
 import org.apache.derby.iapi.services.locks.*;
 import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.shared.common.sanity.AssertFailure;
 
 import org.apache.derby.iapi.error.StandardException;
 
@@ -1161,6 +1162,13 @@
 			// expect thread interrupted exception
 			if (!se.getMessageId().equals("08000")) {
 				throw se;
+			}
+		} catch (AssertFailure af) {
+			// When running in sane mode, an AssertFailure will be thrown if we
+			// try to double latch a page.
+			if (!(SanityManager.DEBUG &&
+				  af.getMessage().endsWith("Attempted to latch page twice"))) {
+				throw af;
 			}
 		}
 



Mime
View raw message