You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ma...@apache.org on 2010/07/21 22:00:23 UTC

svn commit: r966393 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/services/monitor/ engine/org/apache/derby/impl/store/raw/data/ engine/org/apache/derby/loc/ shared/org/apache/derby/shared/common/reference/

Author: mamta
Date: Wed Jul 21 20:00:23 2010
New Revision: 966393

URL: http://svn.apache.org/viewvc?rev=966393&view=rev
Log:
DERBY-4601 Shutting down just a single database should log a different message than shutting down the system

Log the engine shutdown message in derby.log. The existing message logging for each individual connection close which happen because of engine shutdown will still be logged but they will now print the name of the database being shutdown. 


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java?rev=966393&r1=966392&r2=966393&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java Wed Jul 21 20:00:23 2010
@@ -45,6 +45,7 @@ import org.apache.derby.iapi.error.Shutd
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.uuid.UUIDFactory;
 import org.apache.derby.iapi.services.timer.TimerFactory;
+import org.apache.derby.iapi.reference.MessageId;
 import org.apache.derby.iapi.reference.Module;
 import org.apache.derby.iapi.reference.Property;
 import org.apache.derby.iapi.reference.SQLState;
@@ -68,6 +69,8 @@ import org.apache.derby.iapi.services.jm
 
 import org.apache.derby.impl.services.monitor.StorageFactoryService;
 
+import org.apache.derby.iapi.util.CheapDateFormatter;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringWriter;
@@ -117,6 +120,9 @@ abstract class BaseMonitor
 		Hash table of objects that implement PersistentService keyed by their getType() method.
 	*/
 	private HashMap serviceProviders = new HashMap();
+	private static final String LINE = 
+        "----------------------------------------------------------------";
+    private final static char COLON = ':';
 
 	// Vector of class objects of implementations, found in the System, application
 	// and default (modules.properties) properties
@@ -173,6 +179,13 @@ abstract class BaseMonitor
 				return;
 			inShutdown = true;
 		}
+		long shutdownTime = System.currentTimeMillis();
+		//Make a note of Engine shutdown in the log file
+		Monitor.getStream().printlnWithHeader("\n" + CheapDateFormatter.formatDate(shutdownTime) +
+				COLON +
+                MessageService.getTextMessage(
+                    MessageId.CONN_SHUT_DOWN_ENGINE));
+		Monitor.getStream().println(LINE);
 
 		if (SanityManager.DEBUG && reportOn) {
 			report("Shutdown request");

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=966393&r1=966392&r2=966393&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java Wed Jul 21 20:00:23 2010
@@ -482,7 +482,8 @@ public class BaseDataFileFactory
 		logMsg("\n" + CheapDateFormatter.formatDate(shutdownTime) +
                 MessageService.getTextMessage(
                     MessageId.STORE_SHUTDOWN_MSG,
-                    getIdentifier(), 
+                    getIdentifier(),
+                    getRootDirectory(),
                     // print object and ide of classloader.
                     // Cast to object so we don't get just the toString() 
                     // method

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml?rev=966393&r1=966392&r2=966393&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml Wed Jul 21 20:00:23 2010
@@ -7500,8 +7500,9 @@ on database directory {2}  with class lo
             <msg>
                 <name>D002</name>
                 <text>:
-Shutting down instance {0} with class loader {1} </text>
+Shutting down instance {0} on database directory {1} with class loader {2} </text>
                 <arg>id</arg>
+                <arg>dbDirectory</arg>
 		<arg>classloader</arg>
             </msg>
 
@@ -7630,6 +7631,11 @@ Shutting down instance {0} with class lo
             <title>Undocumented JDBC Messages</title>
 
             <msg>
+                <name>J003</name>
+                <text>Shutting down Derby Engine</text>
+            </msg>
+
+            <msg>
                 <name>J004</name>
                 <text>database identity</text>
             </msg>

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java?rev=966393&r1=966392&r2=966393&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java (original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java Wed Jul 21 20:00:23 2010
@@ -111,6 +111,7 @@ public interface MessageId {
 	/*
 	** Connectivity
 	*/
+	String CONN_SHUT_DOWN_ENGINE		    = "J003"; // shutting down Derby Engine
 	String CONN_DATABASE_IDENTITY			= "J004"; // database identity
 	String CONN_SHUT_DOWN_CLOUDSCAPE		= "J005"; // shut down Derby
 	String CONN_CREATE_DATABASE				= "J007"; // create database