db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r789103 - in /db/derby/code/branches/10.5: ./ java/engine/org/apache/derby/impl/services/monitor/ java/testing/org/apache/derbyTesting/functionTests/tests/engine/
Date Sun, 28 Jun 2009 14:44:31 GMT
Author: kahatlen
Date: Sun Jun 28 14:44:31 2009
New Revision: 789103

URL: http://svn.apache.org/viewvc?rev=789103&view=rev
Log:
DERBY-2074: NullPointerException when two threads load sort factory concurrently

Merged fix from trunk (revision 788670).

Added:
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/engine/ModuleLoadingTest.java
      - copied unchanged from r788670, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/ModuleLoadingTest.java
Modified:
    db/derby/code/branches/10.5/   (props changed)
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/ModuleInstance.java
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/TopService.java
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/engine/_Suite.java

Propchange: db/derby/code/branches/10.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jun 28 14:44:31 2009
@@ -1 +1 @@
-/db/derby/code/trunk:772090,772449,772534,774281,779681,782991,785163,785570,785662,788369,788968
+/db/derby/code/trunk:772090,772449,772534,774281,779681,782991,785163,785570,785662,788369,788670,788968

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/ModuleInstance.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/ModuleInstance.java?rev=789103&r1=789102&r2=789103&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/ModuleInstance.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/ModuleInstance.java
Sun Jun 28 14:44:31 2009
@@ -56,6 +56,9 @@
 	*/
 	protected Object	service;
 
+    /** Flag that tells whether booting of the module has completed. */
+    private boolean booted;
+
 	/*
 	** Constructor
 	*/
@@ -111,4 +114,20 @@
 	protected Object getInstance() {
 		return instance;
 	}
+
+    /**
+     * Set a flag that indicates that booting of the module has completed.
+     */
+    synchronized void setBooted() {
+        booted = true;
+    }
+
+    /**
+     * Check whether booting of the module has completed.
+     * @return {@code true} if the module has been booted, or {@code false}
+     * otherwise
+     */
+    synchronized boolean isBooted() {
+        return booted;
+    }
 }

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/TopService.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/TopService.java?rev=789103&r1=789102&r2=789103&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/TopService.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/services/monitor/TopService.java
Sun Jun 28 14:44:31 2009
@@ -255,6 +255,16 @@
 			for (int i = 0; i < moduleInstances.size(); i++) {
 				ModuleInstance module = (ModuleInstance) moduleInstances.elementAt(i);
 
+                // DERBY-2074: The module has not been properly booted, so we
+                // cannot yet determine whether or not this is a module we can
+                // use. Assume that we cannot use it and continue looking. We
+                // may end up booting the module twice if the assumption
+                // doesn't hold, but we'll detect and resolve that later when
+                // we call addToProtocol().
+                if (!module.isBooted()) {
+                    continue;
+                }
+
 				if (!module.isTypeAndName((PersistentService) null, key.getFactoryInterface(), key.getIdentifier()))
 					continue;
 
@@ -294,6 +304,8 @@
 			throw se;
 		}
 
+        module.setBooted();
+
 		synchronized (this) {
 
 

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/engine/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/engine/_Suite.java?rev=789103&r1=789102&r2=789103&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/engine/_Suite.java
(original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/engine/_Suite.java
Sun Jun 28 14:44:31 2009
@@ -47,6 +47,7 @@
         TestSuite suite = new TestSuite("engine");
 
         suite.addTest(ErrorStreamTest.suite());
+        suite.addTest(ModuleLoadingTest.suite());
 
         return suite;
     }



Mime
View raw message