db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r1164358 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java
Date Fri, 02 Sep 2011 06:32:53 GMT
Author: kristwaa
Date: Fri Sep  2 06:32:53 2011
New Revision: 1164358

URL: http://svn.apache.org/viewvc?rev=1164358&view=rev
Log:
DERBY-5390: NPE in BasicDatabase.stop in replication slave mode (dd.clearSequenceCaches)

Added check to see if the data dictionary is available.

Patch file: derby-5390-1a_check_for_null.diff

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java?rev=1164358&r1=1164357&r2=1164358&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java Fri Sep  2
06:32:53 2011
@@ -241,13 +241,16 @@ public class BasicDatabase implements Mo
     }
 
 	public void stop() {
-        try {
-            // on orderly shutdown, try not to leak unused numbers from the sequence generators.
-            dd.clearSequenceCaches();
-        }
-        catch (Throwable t)
-        {
-            t.printStackTrace(Monitor.getStream().getPrintWriter());
+        // The data dictionary is not available if this database has the
+        // role as an active replication slave database.
+        if (dd != null) {
+            try {
+                // on orderly shutdown, try not to leak unused numbers from
+                // the sequence generators.
+                dd.clearSequenceCaches();
+            } catch (StandardException se) {
+                se.printStackTrace(Monitor.getStream().getPrintWriter());
+            }
         }
 		active = false;
 	}



Mime
View raw message