db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r989696 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/store/raw/data/ engine/org/apache/derby/loc/ testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Thu, 26 Aug 2010 13:59:26 GMT
Author: bpendleton
Date: Thu Aug 26 13:59:26 2010
New Revision: 989696

URL: http://svn.apache.org/viewvc?rev=989696&view=rev
Log:
DERBY-1958: Improve XSDG3 error to print container, operation, and name

This patch was contributed by Eranda Sooriyabandara (070468D at gmail dot com)

This patch modifies message XSDG3 ("Metadata for container could not be
accessed") to provide additional information about which container, precisely,
is having the problem. The message now includes the container identity and
the container file name, as well as the type of access to the container
that encountered the problem.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InputStreamContainer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InputStreamContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InputStreamContainer.java?rev=989696&r1=989695&r2=989696&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InputStreamContainer.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InputStreamContainer.java
Thu Aug 26 13:59:26 2010
@@ -95,7 +95,10 @@ final class InputStreamContainer extends
 
         } catch (IOException ioe) {
             throw StandardException.
-                newException(SQLState.FILE_CONTAINER_EXCEPTION, ioe, this);
+                newException(SQLState.FILE_CONTAINER_EXCEPTION, 
+                             ioe,
+                             new Object[] {getIdentity().toString(),
+                                           "open", newIdentity.toString()});
         } finally {
 			if (dis != null) {
 				try {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java?rev=989696&r1=989695&r2=989696&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
Thu Aug 26 13:59:26 2010
@@ -94,6 +94,7 @@ class RAFContainer extends FileContainer
 
 	private boolean inBackup = false;
 	private boolean inRemove = false;
+        private String fileName;
 
 
 	/*
@@ -543,7 +544,10 @@ class RAFContainer extends FileContainer
 
 					throw dataFactory.markCorrupt(
                         StandardException.newException(
-                            SQLState.FILE_CONTAINER_EXCEPTION, ioe, this));
+                            SQLState.FILE_CONTAINER_EXCEPTION, ioe,
+                            getIdentity() != null ?
+                               getIdentity().toString() : "unknown",
+                            "clean", fileName));
 				}
 			}
 		}
@@ -1242,9 +1246,10 @@ class RAFContainer extends FileContainer
             
         }catch (IOException ioe) {
             throw StandardException.newException(
-                                    SQLState.FILE_CONTAINER_EXCEPTION, 
-                                    ioe, 
-                                    newFile);
+                                    SQLState.FILE_CONTAINER_EXCEPTION, ioe,
+                                    getIdentity() != null ?
+                                        getIdentity().toString() : "unknown",
+                                    "encrypt", newFilePath);
         } finally {
 
             if (page != null) {
@@ -1259,9 +1264,10 @@ class RAFContainer extends FileContainer
                 {
                     newRaf = null;
                     throw StandardException.newException(
-                                    SQLState.FILE_CONTAINER_EXCEPTION, 
-                                    ioe, 
-                                    newFile);
+                                    SQLState.FILE_CONTAINER_EXCEPTION, ioe,
+                                    getIdentity() != null ?
+                                        getIdentity().toString() : "unknown",
+                                    "encrypt-close", newFilePath);
                     
                 }
             }
@@ -1407,6 +1413,7 @@ class RAFContainer extends FileContainer
              } catch (SecurityException se) {
                  // just means we can't write to it.
              }
+             fileName = file.toString();
 
              try {
 
@@ -1428,8 +1435,11 @@ class RAFContainer extends FileContainer
                      throw dataFactory.
                          markCorrupt(StandardException.
                                      newException(SQLState.
-                                                  FILE_CONTAINER_EXCEPTION, 
-                                                  ioe, this));
+                                             FILE_CONTAINER_EXCEPTION, ioe,
+                                             getIdentity() != null ?
+                                                 getIdentity().toString() :
+                                                 "unknown",
+                                             "read", fileName));
                  }
 
                  // maybe it is being stubbified... try that
@@ -1462,7 +1472,11 @@ class RAFContainer extends FileContainer
                              markCorrupt(StandardException.
                                          newException(SQLState.
                                                       FILE_CONTAINER_EXCEPTION,
-                                                      ioe2, this));
+                                             ioe2,
+                                             getIdentity() != null ?
+                                                 getIdentity().toString() :
+                                                 "unknown",
+                                             "delete-stub", fileName));
                      }
 
                      // RESOLVE: this is a temporary hack
@@ -1472,8 +1486,11 @@ class RAFContainer extends FileContainer
                      throw dataFactory.
                          markCorrupt(StandardException.
                                      newException(SQLState.
-                                                  FILE_CONTAINER_EXCEPTION,
-                                                  ioe, this));
+                                                  FILE_CONTAINER_EXCEPTION, ioe,
+                                             getIdentity() != null ?
+                                                 getIdentity().toString() :
+                                                 "unknown",
+                                             "read", fileName));
              }
 
              return this;

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=989696&r1=989695&r2=989696&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 Thu Aug 26 13:59:26
2010
@@ -5724,8 +5724,10 @@ ln=lower-case two-letter ISO-639 languag
 
             <msg>
                 <name>XSDG3.D</name>
-                <text>Meta-data for Container {0} could not be accessed</text>
+                <text>Meta-data for {0} could not be accessed to {1} {2}</text>
                 <arg>containerName</arg>
+                <arg>type</arg>
+                <arg>file</arg>
             </msg>
 
             <msg>

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java?rev=989696&r1=989695&r2=989696&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java
Thu Aug 26 13:59:26 2010
@@ -206,7 +206,7 @@ public final class ErrorCodeTest extends
         		{"XSDG0","Page {0} could not be read from disk.","45000"},
         		{"XSDG1","Page {0} could not be written to disk, please check if the disk is full,
or if a file system limit, such as a quota or a maximum file size, has been reached.","45000"},
         		{"XSDG2","Invalid checksum on Page {0}, expected={1}, on-disk version={2}, page
dump follows: {3}","45000"},
-        		{"XSDG3","Meta-data for Container {0} could not be accessed","45000"},
+        		{"XSDG3","Meta-data for {0} could not be accessed to {1} {2}","45000"},
         		{"XSDG5","Database is not in create mode when createFinished is called.","45000"},
         		{"XSDG6","Data segment directory not found in {0} backup during restore. Please
make sure that backup copy is the right one and it is not corrupted.","45000"},
         		{"XSDG7","Directory {0} could not be removed during restore. Please make sure that
permissions are correct.","45000"},



Mime
View raw message