db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r547042 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/io/ engine/org/apache/derby/impl/services/monitor/ engine/org/apache/derby/impl/store/raw/data/ engine/org/apache/derby/io/ engine/org/apache/derby/loc/ shared/org/apache/...
Date Wed, 13 Jun 2007 21:56:44 GMT
Author: kmarsden
Date: Wed Jun 13 14:56:42 2007
New Revision: 547042

URL: http://svn.apache.org/viewvc?view=rev&rev=547042
Log:
DERBY-700 Derby does not prevent dual boot of database from different
ClassLoaders on Linux


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.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/io/StorageFile.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/SQLState.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile.java Wed Jun 13 14:56:42 2007
@@ -196,6 +196,19 @@
 		}
 	} // End of releaseExclusiveFileLock
 
+    
+    /**
+     * Return Random Acess file to the lock file, that is used to 
+     * get the exclusing file lock.  File locks are not acquired on 
+     * jvms before jdk14, this method just return <code> null </code>. 
+     *
+     * @return null, there is opened lock file. 
+     */
+    public StorageRandomAccessFile getLockedFile() {
+        return null;
+    }
+
+
     /**
      * Get a random access (read/write) file.
      *
@@ -254,13 +267,19 @@
         {
             String[] childList = super.list();
             String parentName = getPath();
-            for( int i = 0; i < childList.length; i++)
-            {
-                if( childList[i].equals( ".") || childList[i].equals( ".."))
-                    continue;
-                DirFile child = new DirFile( parentName, childList[i]);
-                if( ! child.deleteAll())
-                    return false;
+            // temporary workaround for DERBY-2649. check for null, 
+            // if a directory disappears after checking if it is 
+            // a directory but before the list() is called. list() call will
+            // return null if directory does not exist.
+            if (childList != null) {
+                for( int i = 0; i < childList.length; i++)
+                {
+                    if( childList[i].equals( ".") || childList[i].equals( ".."))
+                        continue;
+                    DirFile child = new DirFile( parentName, childList[i]);
+                    if( ! child.deleteAll())
+                        return false;
+                }
             }
         }
         return delete();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java Wed Jun 13 14:56:42 2007
@@ -150,7 +150,7 @@
 			//If we can acquire a reliable exclusive lock , try to get it.
 			if(validExclusiveLock)
 			{
-				lockFileOpen = new RandomAccessFile((File) this, "rw");
+				lockFileOpen = new DirRandomAccessFile4((File) this, "rw");
 				lockFileChannel = lockFileOpen.getChannel();
 				dbLock =lockFileChannel.tryLock();
 				if(dbLock == null)
@@ -163,8 +163,6 @@
 				}
 				else
 				{	
-					lockFileOpen.writeInt(EXCLUSIVE_FILE_LOCK);
-					lockFileChannel.force(true);
 					status = EXCLUSIVE_FILE_LOCK;
 				}
 			}
@@ -221,6 +219,20 @@
 			// problem is
 		}
 	} // End of releaseExclusiveFileLock
+    /**
+     * Return Random Acess file to the lock file, that is used to 
+     * get the exclusing e lock obtained with getExclusiveFileLock(). It can be used  read/write data 
+     * from/to the lock file. 
+     * @return Random access File object used to get the exclusive lock or null 
+     * <code> null </code> if there was no call to getExclusiveFile() lock or 
+     * the call to getExcclusiveFileLock was not successful
+     * 
+     * @see #getExclusiveFileLock
+     */
+    public StorageRandomAccessFile getLockedFile() {    	
+        return (StorageRandomAccessFile) lockFileOpen;
+    }
+
 
     /**
      * Get a random access (read/write) file.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/InputStreamFile.java Wed Jun 13 14:56:42 2007
@@ -383,6 +383,18 @@
     {}
 
     /**
+     * Return Random Acess file to the lock file, that is used to 
+     * get the exclusing file lock.  File locks are not supported 
+     * for this type of file, his method just return <code> null </code>. 
+     *
+     * @return null, there is no locked file. 
+     */
+    public StorageRandomAccessFile getLockedFile() {
+        return null;
+    }
+
+
+    /**
      * Get a random access file.
      *
      * @param mode "r", "rw", "rws", or "rwd". The "rws" and "rwd" modes specify

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java Wed Jun 13 14:56:42 2007
@@ -296,7 +296,6 @@
 
 		synchronized (this) {
 
-
 			// add it to the protocol table, if this returns false then we can't use
 			// this module, shut it down.
 			if (addToProtocol(key, module)) {

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?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- 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 Jun 13 14:56:42 2007
@@ -147,8 +147,8 @@
 
 	private     RawStoreFactory	rawStoreFactory; // associated raw store factory
 
-	private     String			dataDirectory;	 // root directory of files.
 
+	private     String			dataDirectory;	 // root directory of files.
     private     boolean         throwDBlckException; // if true throw db.lck
                                                  // exception, even on systems
                                                  // where lock file is not
@@ -235,6 +235,11 @@
     private File            backupRoot;
     private String[]        bfilelist;
 
+
+    /* derby jvm instance id used to prevent concurrent intra-jvm 
+     * boots of a database */   
+    private static final String DERBY_JVM_ID = "derby.storage.jvmInstanceId";
+
 	/*
 	** Constructor
 	*/
@@ -1855,7 +1860,7 @@
             
             try
             {
-                AccessController.doPrivileged( this);
+               AccessController.doPrivileged( this);
             }
             catch (PrivilegedActionException pae) 
             { 
@@ -1874,7 +1879,10 @@
 		// fileLockOnDB is not null in this case
 	}
 
-    // Called from within a privilege block
+  
+    /**
+     * @throws StandardException
+     */
     private void privGetJBMSLockOnDB() throws StandardException
     {
         boolean fileLockExisted = false;
@@ -1976,8 +1984,8 @@
             //about applying exclusive file lock mechanism 
             if(!throwDBlckException)
             {
-                exFileLock   = 
-                    storageFactory.newStorageFile( DB_EX_LOCKFILE_NAME);
+            		exFileLock   = 
+            			storageFactory.newStorageFile( DB_EX_LOCKFILE_NAME);
                 exLockStatus = exFileLock.getExclusiveFileLock();
             }
 
@@ -2004,7 +2012,7 @@
                 }
             }
 
-            // filelock is unreliable, but we should at least leave a file
+             // filelock is unreliable, but we should at least leave a file
             // there to warn the next person
             try
             {
@@ -2053,7 +2061,23 @@
                     databaseDirectory);
             }
 
+            /* if it reached here means, db is protected from 
+             * being booted by multiple jvm instances. But file lock method 
+             * used to do that does not protect a db being booted by another 
+             * class loader in the same jvm. Get a lock that will
+             * protect the db being booted by another class loader, if 
+             * it is not booted by another class loader already.
+             */
+            try {
+                getIntraJvmDbLock();
+            }catch (IOException ioe) {
+                throw StandardException.newException(
+                   SQLState.DATA_MULTIPLE_CLASSLOADERS_ON_DB, 
+                   ioe, databaseDirectory);
+            }
         }
+
+
     } // end of privGetJBMSLockOnDB
 
 	private void releaseJBMSLockOnDB()
@@ -2080,7 +2104,7 @@
         }
 	}
 
-    private void privReleaseJBMSLockOnDB() throws IOException
+    private void privReleaseJBMSLockOnDB() throws IOException, StandardException
     {
         if (fileLockOnDB != null)
             fileLockOnDB.close();
@@ -2092,12 +2116,16 @@
 
             fileLock.delete();
         }
-
-		//release the lock that is acquired using tryLock() to prevent
-		//multiple jvm booting the same database on Unix environments.
-		if(exFileLock != null)
+        
+		// release the lock that is acquired using tryLock() to prevent
+		// multiple jvm booting the same database on Unix environments.
+		if(exFileLock != null) {
+            // release the intra-jvm lock, that is used 
+            // to prevent database boots from a different class 
+            // loaders in the same jvm.
+            releaseIntraJvmDbLock();
 			exFileLock.releaseExclusiveFileLock();
-
+        }
         return;
     } // end of privReleaseJBMSLockOnDB
         
@@ -2820,7 +2848,12 @@
         }
 
         case GET_LOCK_ON_DB_ACTION:
-            privGetJBMSLockOnDB();
+        	File dataDir = new File (dataDirectory);
+        	String baseName= dataDir.getName().intern();
+            synchronized(baseName) 
+            {   
+            	privGetJBMSLockOnDB();
+            }
             return null;
 
         case RELEASE_LOCK_ON_DB_ACTION:
@@ -2844,4 +2877,175 @@
 		}
         return null;
     } // end of run
-}
+
+
+
+
+    /**
+     * get a unique JVM ID
+     */
+    private UUID getJvmId () 
+    {
+        // synchronize across class loaders.
+        synchronized(DERBY_JVM_ID.intern()) 
+        {
+        	String jvmidStr = null;
+        	try {
+        		jvmidStr = System.getProperty(DERBY_JVM_ID);
+        	}catch (SecurityException se)
+        	{
+        		String[] args = { se.getMessage()};
+              	 String warningMsg = 
+                       MessageService.getCompleteMessage(                        		 
+                           SQLState.DATA_JVM_ID_PROPERTY_ACCESS, args);
+                     logMsg(warningMsg);
+        	
+        	}
+            UUID jvmid = null;
+            // if jvm id does not already exist, generate one
+            // and save it into the "derby.storage.jvmid" system
+            // property.
+            if (jvmidStr == null) {
+                //generate a new UUID based on the time  ..etc.
+                // and store it in a system property to be accessble by 
+                // other instances of derby engine booting inside the 
+                // current jvm instance.
+                jvmid = uuidFactory.createUUID();
+                jvmidStr = jvmid.toString();
+                try {
+                	System.setProperty(DERBY_JVM_ID, jvmidStr);
+                }
+                catch (SecurityException se)
+                {
+                Object[] args = new Exception[] { se};
+               	 String warningMsg = 
+                        MessageService.getCompleteMessage(                        		 
+                            SQLState.DATA_JVM_ID_PROPERTY_ACCESS, args);
+
+                      logMsg(warningMsg);
+                      jvmid = uuidFactory.recreateUUID(jvmidStr);
+                }
+            } else {
+                jvmid = uuidFactory.recreateUUID(jvmidStr);
+            }
+            return jvmid;
+        }
+    }
+
+    /**
+     * 
+     * Get a lock, that will protect the database being booted by 
+     * by multiple class loaders in the same jvm. This is not 
+     * real lock. Lock is simulated by writing down the jvm id 
+     * generated by derby, which is unique across class loaders 
+     * to the dbex.lck file. If the current jvm id matches the one
+     * in the dbex.lck file , database is considered as booted; otherwise 
+     * the jvm id is written to the file to prevent booting by another 
+     * class loader.
+     * 
+     * Pre-cond: should be called only after acquiring the file lock.
+     *  
+     */
+    private void getIntraJvmDbLock() throws StandardException, IOException{
+
+        // file lock can be acquired even if the database is already
+        // booted by a different class loader. Check if another class
+        // loader has booted the DB. This is done by checking the
+        // JVMID written in the dbex.lck file. If the JVMID is same
+        // as what is stored in the system property,
+        // then database is already booted , throw the error.
+        UUID currentJvmId = getJvmId();
+        // synchronizing across the same database, by using interned 
+        // version of the database name
+       
+        
+        	StorageRandomAccessFile lckFileRaf = exFileLock.getLockedFile();
+            if (lckFileRaf == null) {
+            	// could not get exclusive lock
+                throw StandardException.newException(
+                   SQLState.DATA_MULTIPLE_CLASSLOADERS_ON_DB,
+                        databaseDirectory);
+             }
+
+            UUID onDiskJvmId = null; 
+            // read ID from the dbex.lck file.
+            try 
+            {
+                if (exFileLock.length() != 0)
+                    onDiskJvmId = uuidFactory.recreateUUID(lckFileRaf.readUTF());
+            }   
+            catch (Exception e)
+            {
+                // The previous owner of the lock may have died before we
+                // finish writing its UUID down. Assume uuid file is invalid
+                // Set the id on the disk to null value.
+                onDiskJvmId = null;
+            }
+
+            if (onDiskJvmId != null && onDiskJvmId.equals(currentJvmId))
+            {
+                throw StandardException.newException(
+                           SQLState.DATA_MULTIPLE_CLASSLOADERS_ON_DB, databaseDirectory);
+            } else {
+                
+               
+                // write the the jvm id to the dbex.lck file, to prevent 
+                // another loader  booting the same database before it 
+                // is shutdown by the currtent loader. 
+                lckFileRaf.seek(0);
+                lckFileRaf.writeUTF(currentJvmId.toString()); 
+                lckFileRaf.sync(false);
+                  
+            }
+    }
+
+
+    
+    /*
+     * Relelease the intra-jvm db lock. Locking is simulated by writing 
+     * the  derby jvm instance id to the dbex.lck file. This method writes 
+     * an invalid jvm instance id to the dbex.lck file to indicate that 
+     * the database is not booted any more. 
+     * 
+     * Synchronization is provided across class loaders using the interened 
+     * version of the database directory string.
+     */
+    private void releaseIntraJvmDbLock() throws IOException, StandardException
+    {
+        // write a uuid, that would have never been a jvm id generated by derby. 
+        String invalidJvmId = "00000000-0000-0000-0000-000000000000"; 
+        StorageRandomAccessFile lckFileRaf = null;
+        /*
+         * I think following synchronization is needed, because If any part 
+         * of the above UUID gets written to the file, then other loaders 
+         * might assume db  not booted any more, Other  Loader might boot 
+         * and overwrite part of what is writen and result in an corrupted
+         * id in the dbex.lck file , which can cause expected format errors
+         * or allow another loader to boot the database , that is already
+         * booted.
+         */
+        // synchronizing across the same database, by using interened 
+        // version of the database name
+                
+        synchronized(dataDirectory.intern()) {
+        lckFileRaf = exFileLock.getLockedFile();
+        if (lckFileRaf != null) 
+        {
+    
+        	// update the jvmid in the dbex.lck file to an invalid one, 
+        	// to indicate this db is shutdown. Becuase current jvmid will not 
+        	// match with the invalid one on the disk, db can booted
+        	// succcessfully.
+        	lckFileRaf.seek(0);
+        	lckFileRaf.writeUTF(invalidJvmId); 
+        	lckFileRaf.sync(false);
+            	
+        }
+        else
+        {
+            throw StandardException.newException(
+                SQLState.DATA_MULTIPLE_CLASSLOADERS_ON_DB, databaseDirectory);
+        	}
+        }
+    }
+}
\ No newline at end of file

Modified: db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/io/StorageFile.java Wed Jun 13 14:56:42 2007
@@ -261,6 +261,19 @@
 	public void releaseExclusiveFileLock();
 
     /**
+     * Return Random Acess file to the lock file, that is used to 
+     * get the exclusing e lock obtained with getExclusiveFileLock(). It can be used  read/write data 
+     * from/to the lock file. 
+     * @return Random access File object used to get the exclusive lock or null 
+     * <code> null </code> if there was no call to getExclusiveFile() lock or 
+     * the call to getExcclusiveFileLock was not successful
+     * 
+     * @see #getExclusiveFileLock
+     */
+    public StorageRandomAccessFile getLockedFile();
+
+
+    /**
      * Get a random access file.
      *
      * This method is not called if the StorageFactory is read only. It is unspecified if the StorageFactory

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?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- 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 Jun 13 14:56:42 2007
@@ -5037,6 +5037,17 @@
                 <text>Attempt to allocate object {0} failed.</text>
                 <arg>object</arg>
             </msg>
+            <msg>
+                 <name>XSDBB.D</name>
+                 <text> >Another instance of Derby within the same JVM may have already booted the database {0}. Only a single classloader within the same JVM can boot the database.</text>
+                 <arg>databaseName</arg>
+           </msg>
+
+           <msg>
+                <name> XSDBC.D </name>
+               <text> WARNING: {0}. Derby cannot acess  the system property derby.storage.jvmInstanceId. This permission is necessary for Derby to detect multiple Classloader boot of the database.  Without this permission corruption could occur. Add the permission permission: java.util.PropertyPermision "derby.storage.jvmInstanceId", "read,write"  to your policy file. </text>
+          <arg> exception </arg>
+           </msg>
 
         </family>
 

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java (original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java Wed Jun 13 14:56:42 2007
@@ -22,6 +22,7 @@
 package org.apache.derby.shared.common.reference;
 
 
+
 /**
 	List of error message identifiers.
 	This is the set of message identifiers. The message identifier
@@ -491,7 +492,9 @@
 	String DATA_MULTIPLE_JBMS_FORCE_LOCK                        = "XSDB8.D";
 	String DATA_CORRUPT_STREAM_CONTAINER                        = "XSDB9.D";
 	String DATA_OBJECT_ALLOCATION_FAILED                        = "XSDBA.D";
-
+    String DATA_MULTIPLE_CLASSLOADERS_ON_DB                     = "XSDBB.D";
+    String DATA_JVM_ID_PROPERTY_ACCESS			            	= "XSDBC.D";
+    
 	/*
 	** RawStore - Data.Filesystem statement exceptions
 	*/

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?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- 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 Wed Jun 13 14:56:42 2007
@@ -25,6 +25,7 @@
 import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 import org.apache.derbyTesting.junit.Utilities;
 
@@ -52,7 +53,17 @@
     {
         TestSuite suite = new TestSuite("errorcode Test");
         suite.addTest(TestConfiguration.embeddedSuite(ErrorCodeTest.class));
-        return suite;
+        return new CleanDatabaseTestSetup(suite) {
+        	   protected void decorateSQL(Statement s) throws SQLException
+               { 	
+        		   s.executeUpdate(
+        		   "create table t(i int, s smallint)");
+        		   s.executeUpdate(
+        		   "insert into t values (1,2)");
+        		   s.executeUpdate("insert into t values (1,2)");
+        		   s.executeUpdate("insert into t values (null,2)");
+               }
+        };	
     }
 
     public void test_errorcode() throws Exception
@@ -61,13 +72,6 @@
         
         Statement s = createStatement();
         
-        s.executeUpdate(
-            "create table t(i int, s smallint)");
-        s.executeUpdate(
-            "insert into t values (1,2)");
-        s.executeUpdate("insert into t values (1,2)");
-        s.executeUpdate("insert into t values (null,2)");
-        
         //-- parser error
         //-- bug 5701        
         assertStatementError("42X01",30000,s,"create table t(i nt, s smallint)");
@@ -97,150 +101,155 @@
         // new ones can be added.
         rs = s.executeQuery("select * from SYSCS_DIAG.Error_messages where SEVERITY >= 40000 order by SQL_STATE");
         //Utilities.showResultSet(rs);
-        String [][] expectedRows = 
-            {{"08000","Connection closed by unknown interrupt.","40000"},
-             {"08001","A connection could not be established because the security token is larger than the maximum allowed by the network protocol.","40000"},
-             {"08001","A connection could not be established because the user id has a length of zero or is larger than the maximum allowed by the network protocol.","40000"},
-             {"08001","A connection could not be established because the password has a length of zero or is larger than the maximum allowed by the network protocol.","40000"},
-             {"08001","Required Derby DataSource property {0} not set.","40000"},
-             {"08001","{0} : Error connecting to server {1} on port {2} with message {3}.","40000"},
-             {"08001","SocketException: '{0}'","40000"},
-             {"08001","Unable to open stream on socket: '{0}'.","40000"},
-             {"08001","User id length ({0}) is outside the range of 1 to {1}.","40000"},
-             {"08001","Password length ({0}) is outside the range of 1 to {1}.","40000"},
-             {"08001","User id can not be null.","40000"},
-             {"08001","Password can not be null.","40000"},
-             {"08001","A connection could not be established because the database name '{0}' is larger than the maximum length allowed by the network protocol.","40000"},
-             {"08003","No current connection.","40000"},
-             {"08003","getConnection() is not valid on a closed PooledConnection.","40000"},
-             {"08003","Lob method called after connection was closed","40000"},
-             {"08003","The underlying physical connection is stale or closed.","40000"},
-             {"08004","Connection refused : {0}","40000"},
-             {"08004","Connection authentication failure occurred.  Reason: {0}.","40000"},
-             {"08004","The connection was refused because the database {0} was not found.","40000"},
-             {"08004","Database connection refused.","40000"},
-             {"08004","User '{0}' cannot shut down database '{1}'. Only the database owner can perform this operation.","40000"},
-             {"08004","User '{0}' cannot (re)encrypt database '{1}'. Only the database owner can perform this operation.","40000"},
-             {"08004","User '{0}' cannot hard upgrade database '{1}'. Only the database owner can perform this operation.","40000"},
-             {"08006","An error occurred during connect reset and the connection has been terminated.  See chained exceptions for details.","40000"},
-             {"08006","Database '{0}' shutdown.","45000"},
-             {"0A000","The DRDA command {0} is not currently implemented.  The connection has been terminated.","40000"},
-             {"57017","There is no available conversion for the source code page, {0}, to the target code page, {1}.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: only one of the VCM, VCS length can be greater than 0.  The connection has been terminated.","40000"},
-             {"58009","The connection was terminated because the encoding is not supported.","40000"},
-             {"58009","Network protocol exception: actual code point, {0}, does not match expected code point, {1}.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: DDM collection contains less than 4 bytes of data.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: collection stack not empty at end of same id chain parse.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: DSS length not 0 at end of same id chain parse.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: DSS chained with same id at end of same id chain parse.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: end of stream prematurely reached while reading InputStream, parameter #{0}.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: invalid FDOCA LID.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: SECTKN was not returned.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: only one of NVCM, NVCS can be non-null.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: SCLDTA length, {0}, is invalid for RDBNAM.  The connection has been terminated.","40000"},
-             {"58009","SocketException: '{0}'","40000"},
-             {"58009","A communications error has been detected: {0}.","40000"},
-             {"58009","An error occurred during a deferred connect reset and the connection has been terminated.  See chained exceptions for details.","40000"},
-             {"58009","Insufficient data while reading from the network - expected a minimum of {0} bytes and received only {1} bytes.  The connection has been terminated.","40000"},
-             {"58009","Attempt to fully materialize lob data that is too large for the JVM.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: SCLDTA length, {0}, is invalid for RDBCOLID.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: SCLDTA length, {0}, is invalid for PKGID.  The connection has been terminated.","40000"},
-             {"58009","Network protocol exception: PKGNAMCSN length, {0}, is invalid at SQLAM {1}.  The connection has been terminated.","40000"},
-             {"58009","A network protocol error was encountered and the connection has been terminated: {0}","40000"},
-             {"58010","A network protocol error was encountered.  A connection could not be established because the manager {0} at level {1} is not supported by the server.","40000"},
-             {"58014","The DDM command 0x{0} is not supported.  The connection has been terminated.","40000"},
-             {"58015","The DDM object 0x{0} is not supported.  The connection has been terminated.","40000"},
-             {"58016","The DDM parameter 0x{0} is not supported.  The connection has been terminated.","40000"},
-             {"58017","The DDM parameter value 0x{0} is not supported.  An input host variable may not be within the range the server supports.  The connection has been terminated.","40000"},
-             {"XBM01","Startup failed due to an exception. See next exception for details.","45000"},
-             {"XBM02","Startup failed due to missing functionality for {0}. Please ensure your classpath includes the correct Derby software.","45000"},
-             {"XBM03","Supplied value '{0}' for collation attribute is invalid, expecting UCS_BASIC or TERRITORY_BASED.","45000"},
-             {"XBM05","Startup failed due to missing product version information for {0}.","45000"},
-             {"XBM06","Startup failed. An encrypted database cannot be accessed without the correct boot password.","45000"},
-             {"XBM07","Startup failed. Boot password must be at least 8 bytes long.","45000"},
-             {"XBM08","Could not instantiate {0} StorageFactory class {1}.","45000"},
-             {"XBM0G","Failed to start encryption engine. Please make sure you are running Java 2 and have downloaded an encryption provider such as jce and put it in your class path.","45000"},
-             {"XBM0H","Directory {0} cannot be created.","45000"},
-             {"XBM0I","Directory {0} cannot be removed.","45000"},
-             {"XBM0J","Directory {0} already exists.","45000"},
-             {"XBM0K","Unknown sub-protocol for database name {0}.","45000"},
-             {"XBM0L","Specified authentication scheme class {0} does implement the authentication interface {1}.","45000"},
-             {"XBM0M","Error creating instance of authentication scheme class {0}.","45000"},
-             {"XBM0N","JDBC Driver registration with java.sql.DriverManager failed. See next exception for details.","45000"},
-             {"XBM0P","Service provider is read-only. Operation not permitted.","45000"},
-             {"XBM0Q","File {0} not found. Please make sure that backup copy is the correct one and it is not corrupted.","45000"},
-             {"XBM0R","Unable to remove File {0}.","45000"},
-             {"XBM0S","Unable to rename file '{0}' to '{1}'","45000"},
-             {"XBM0T","Ambiguous sub-protocol for database name {0}.","45000"},
-             {"XBM0X","Supplied territory description '{0}' is invalid, expecting ln[_CO[_variant]]\nln=lower-case two-letter ISO-639 language code, CO=upper-case two-letter ISO-3166 country codes, see java.util.Locale.","45000"},
-             {"XBM0Y","Backup database directory {0} not found. Please make sure that the specified backup path is right.","45000"},
-             {"XBM0Z","Unable to copy file '{0}' to '{1}'. Please make sure that there is enough space and permissions are correct.","45000"},
-             {"XCW00","Unsupported upgrade from '{0}' to '{1}'.","45000"},
-             {"XJ004","Database '{0}' not found.","40000"},
-             {"XJ015","Derby system shutdown.","50000"},
-             {"XJ028","The URL '{0}' is not properly formed.","40000"},
-             {"XJ040","Failed to start database '{0}', see the next exception for details.","40000"},
-             {"XJ041","Failed to create database '{0}', see the next exception for details.","40000"},
-             {"XJ049","Conflicting create attributes specified.","40000"},
-             {"XJ05B","JDBC attribute '{0}' has an invalid value '{1}', valid values are '{2}'.","40000"},
-             {"XJ081","Conflicting create/restore/recovery attributes specified.","40000"},
-             {"XJ213","The traceLevel connection property does not have a valid format for a number.","40000"},
-             {"XSDB0","Unexpected exception on in-memory page {0}","45000"},
-             {"XSDB1","Unknown page format at page {0}","45000"},
-             {"XSDB2","Unknown container format at container {0} : {1}","45000"},
-             {"XSDB3","Container information cannot change once written: was {0}, now {1}","45000"},
-             {"XSDB4","Page {0} is at version {1}, the log file contains change version {2}, either there are log records of this page missing, or this page did not get written out to disk properly.","45000"},
-             {"XSDB5","Log has change record on page {0}, which is beyond the end of the container.","45000"},
-             {"XSDB6","Another instance of Derby may have already booted the database {0}.","45000"},
-             {"XSDB7","WARNING: Derby (instance {0}) is attempting to boot the database {1} even though Derby (instance {2}) may still be active.  Only one instance of Derby should boot a database at a time. Severe and non-recoverable corruption can result and may have already occurred.","45000"},
-             {"XSDB8","WARNING: Derby (instance {0}) is attempting to boot the database {1} even though Derby (instance {2}) may still be active.  Only one instance of Derby should boot a database at a time. Severe and non-recoverable corruption can result if 2 instances of Derby boot on the same database at the same time.  The db2j.database.forceDatabaseLock=true property has been set, so the database will not boot until the db.lck is no longer present.  Normally this file is removed when the first instance of Derby to boot on the database exits, but it may be left behind in some shutdowns.  It will be necessary to remove the file by hand in that case.  It is important to verify that no other VM is accessing the database before deleting the db.lck file by hand.","45000"},
-             {"XSDB9","Stream container {0} is corrupt.","45000"},
-             {"XSDBA","Attempt to allocate object {0} failed.","45000"},
-             {"XSDG0","Page {0} could not be read from disk.","45000"},
-             {"XSDG1","Page {0} could not be written to disk, please check if disk is full.","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"},
-             {"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"},
-             {"XSDG8","Unable to copy directory '{0}' to '{1}' during restore. Please make sure that there is enough space and permissions are correct.","45000"},
-             {"XSLA0","Cannot flush the log file to disk {0}.","45000"},
-             {"XSLA1","Log Record has been sent to the stream, but it cannot be applied to the store (Object {0}).  This may cause recovery problems also.","45000"},
-             {"XSLA2","System will shutdown, got I/O Exception while accessing log file.","45000"},
-             {"XSLA3","Log Corrupted, has invalid data in the log stream.","45000"},
-             {"XSLA4","Cannot write to the log, most likely the log is full.  Please delete unnecessary files.  It is also possible that the file system is read only, or the disk has failed, or some other problems with the media.","45000"},
-             {"XSLA5","Cannot read log stream for some reason to rollback transaction {0}.","45000"},
-             {"XSLA6","Cannot recover the database.","45000"},
-             {"XSLA7","Cannot redo operation {0} in the log.","45000"},
-             {"XSLA8","Cannot rollback transaction {0}, trying to compensate {1} operation with {2}","45000"},
-             {"XSLAA","The store has been marked for shutdown by an earlier exception.","45000"},
-             {"XSLAB","Cannot find log file {0}, please make sure your logDevice property is properly set with the correct path separator for your platform.","45000"},
-             {"XSLAC","Database at {0} have incompatible format with the current version of software, it may have been created by or upgraded by a later version.","45000"},
-             {"XSLAD","log Record at instant {2} in log file {3} corrupted. Expected log record length {0}, real length {1}.","45000"},
-             {"XSLAE","Control file at {0} cannot be written or updated.","45000"},
-             {"XSLAF","A Read Only database was created with dirty data buffers.","45000"},
-             {"XSLAH","A Read Only database is being updated.","45000"},
-             {"XSLAI","Cannot log the checkpoint log record","45000"},
-             {"XSLAJ","The logging system has been marked to shut down due to an earlier problem and will not allow any more operations until the system shuts down and restarts.","45000"},
-             {"XSLAK","Database has exceeded largest log file number {0}.","45000"},
-             {"XSLAL","log record size {2} exceeded the maximum allowable log file size {3}. Error encountered in log file {0}, position {1}.","45000"},
-             {"XSLAM","Cannot verify database format at {1} due to IOException.","45000"},
-             {"XSLAN","Database at {0} has an incompatible format with the current version of the software.  The database was created by or upgraded by version {1}.","45000"},
-             {"XSLAO","Recovery failed unexpected problem {0}.","45000"},
-             {"XSLAP","Database at {0} is at version {1}. Beta databases cannot be upgraded,","45000"},
-             {"XSLAQ","cannot create log file at directory {0}.","45000"},
-             {"XSLAR","Unable to copy log file '{0}' to '{1}' during restore. Please make sure that there is enough space and permissions are correct.","45000"},
-             {"XSLAS","Log directory {0} not found in backup during restore. Please make sure that backup copy is the correct one and it is not corrupted.","45000"},
-             {"XSLAT","The log directory '{0}' exists. The directory might belong to another database. Check that the location specified for the logDevice attribute is correct.","45000"},
-             {"XSTB0","An exception was thrown during transaction abort.","50000"},
-             {"XSTB2","Cannot log transaction changes, maybe trying to write to a read only database.","50000"},
-             {"XSTB3","Cannot abort transaction because the log manager is null, probably due to an earlier error.","50000"},
-             {"XSTB5","Creating database with logging disabled encountered unexpected problem.","50000"},
-             {"XSTB6","Cannot substitute a transaction table with another while one is already in use.","50000"},
-             {"XXXXX","Normal database session close.","40000"}};
+        
+        String [][] expectedRows =
+        {{"08000","Connection closed by unknown interrupt.","40000"},
+        		{"08001","Required Derby DataSource property {0} not set.","40000"},
+        		{"08001","{0} : Error connecting to server {1} on port {2} with message {3}.","40000"},
+        		{"08001","SocketException: '{0}'","40000"},
+        		{"08001","Unable to open stream on socket: '{0}'.","40000"},
+        		{"08001","User id length ({0}) is outside the range of 1 to {1}.","40000"},
+        		{"08001","A connection could not be established because the security token is larger than the maximum allowed by the network protocol.","40000"},
+        		{"08001","A connection could not be established because the user id has a length of zero or is larger than the maximum allowed by the network protocol.","40000"},
+        		{"08001","A connection could not be established because the password has a length of zero or is larger than the maximum allowed by the network protocol.","40000"},
+        		{"08001","Password length ({0}) is outside the range of 1 to {1}.","40000"},
+        		{"08001","User id can not be null.","40000"},
+        		{"08001","Password can not be null.","40000"},
+        		{"08001","A connection could not be established because the database name '{0}' is larger than the maximum length allowed by the network protocol.","40000"},
+        		{"08003","No current connection.","40000"},
+        		{"08003","getConnection() is not valid on a closed PooledConnection.","40000"},
+        		{"08003","Lob method called after connection was closed","40000"},
+        		{"08003","The underlying physical connection is stale or closed.","40000"},
+        		{"08004","Connection refused : {0}","40000"},
+        		{"08004","Connection authentication failure occurred.  Reason: {0}.","40000"},
+        		{"08004","The connection was refused because the database {0} was not found.","40000"},
+        		{"08004","Database connection refused.","40000"},
+        		{"08004","User '{0}' cannot shut down database '{1}'. Only the database owner can perform this operation.","40000"},
+        		{"08004","User '{0}' cannot (re)encrypt database '{1}'. Only the database owner can perform this operation.","40000"},
+        		{"08004","User '{0}' cannot hard upgrade database '{1}'. Only the database owner can perform this operation.","40000"},
+        		{"08006","An error occurred during connect reset and the connection has been terminated.  See chained exceptions for details.","40000"},
+        		{"08006","Database '{0}' shutdown.","45000"},
+        		{"0A000","The DRDA command {0} is not currently implemented.  The connection has been terminated.","40000"},
+        		{"57017","There is no available conversion for the source code page, {0}, to the target code page, {1}.  The connection has been terminated.","40000"},
+        		{"58009","SocketException: '{0}'","40000"},
+        		{"58009","A communications error has been detected: {0}.","40000"},
+        		{"58009","An error occurred during a deferred connect reset and the connection has been terminated.  See chained exceptions for details.","40000"},
+        		{"58009","Insufficient data while reading from the network - expected a minimum of {0} bytes and received only {1} bytes.  The connection has been terminated.","40000"},
+        		{"58009","Attempt to fully materialize lob data that is too large for the JVM.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: SCLDTA length, {0}, is invalid for RDBCOLID.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: SCLDTA length, {0}, is invalid for PKGID.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: PKGNAMCSN length, {0}, is invalid at SQLAM {1}.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: only one of the VCM, VCS length can be greater than 0.  The connection has been terminated.","40000"},
+        		{"58009","The connection was terminated because the encoding is not supported.","40000"},
+        		{"58009","Network protocol exception: actual code point, {0}, does not match expected code point, {1}.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: DDM collection contains less than 4 bytes of data.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: collection stack not empty at end of same id chain parse.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: DSS length not 0 at end of same id chain parse.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: DSS chained with same id at end of same id chain parse.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: end of stream prematurely reached while reading InputStream, parameter #{0}.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: invalid FDOCA LID.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: SECTKN was not returned.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: only one of NVCM, NVCS can be non-null.  The connection has been terminated.","40000"},
+        		{"58009","Network protocol exception: SCLDTA length, {0}, is invalid for RDBNAM.  The connection has been terminated.","40000"},
+        		{"58009","A network protocol error was encountered and the connection has been terminated: {0}","40000"},
+        		{"58010","A network protocol error was encountered.  A connection could not be established because the manager {0} at level {1} is not supported by the server. ","40000"},
+        		{"58014","The DDM command 0x{0} is not supported.  The connection has been terminated.","40000"},
+        		{"58015","The DDM object 0x{0} is not supported.  The connection has been terminated.","40000"},
+        		{"58016","The DDM parameter 0x{0} is not supported.  The connection has been terminated.","40000"},
+        		{"58017","The DDM parameter value 0x{0} is not supported.  An input host variable may not be within the range the server supports.  The connection has been terminated.","40000"},
+        		{"XBM01","Startup failed due to an exception. See next exception for details. ","45000"},
+        		{"XBM02","Startup failed due to missing functionality for {0}. Please ensure your classpath includes the correct Derby software.","45000"},
+        		{"XBM03","Supplied value '{0}' for collation attribute is invalid, expecting UCS_BASIC or TERRITORY_BASED.","45000"},
+        		{"XBM05","Startup failed due to missing product version information for {0}.","45000"},
+        		{"XBM06","Startup failed. An encrypted database cannot be accessed without the correct boot password.  ","45000"},
+        		{"XBM07","Startup failed. Boot password must be at least 8 bytes long.","45000"},
+        		{"XBM08","Could not instantiate {0} StorageFactory class {1}.","45000"},
+        		{"XBM0G","Failed to start encryption engine. Please make sure you are running Java 2 and have downloaded an encryption provider such as jce and put it in your class path. ","45000"},
+        		{"XBM0H","Directory {0} cannot be created.","45000"},
+        		{"XBM0I","Directory {0} cannot be removed.","45000"},
+        		{"XBM0J","Directory {0} already exists.","45000"},
+        		{"XBM0K","Unknown sub-protocol for database name {0}.","45000"},
+        		{"XBM0L","Specified authentication scheme class {0} does implement the authentication interface {1}.","45000"},
+        		{"XBM0M","Error creating instance of authentication scheme class {0}.","45000"},
+        		{"XBM0N","JDBC Driver registration with java.sql.DriverManager failed. See next exception for details. ","45000"},
+        		{"XBM0P","Service provider is read-only. Operation not permitted. ","45000"},
+        		{"XBM0Q","File {0} not found. Please make sure that backup copy is the correct one and it is not corrupted.","45000"},
+        		{"XBM0R","Unable to remove File {0}.  ","45000"},
+        		{"XBM0S","Unable to rename file '{0}' to '{1}'","45000"},
+        		{"XBM0T","Ambiguous sub-protocol for database name {0}.   ","45000"},
+        		{"XBM0X","Supplied territory description '{0}' is invalid, expecting ln[_CO[_variant]]\nln=lower-case two-letter ISO-639 language code, CO=upper-case two-letter ISO-3166 country codes, see java.util.Locale.","45000"},
+        		{"XBM0Y","Backup database directory {0} not found. Please make sure that the specified backup path is right.","45000"},
+        		{"XBM0Z","Unable to copy file '{0}' to '{1}'. Please make sure that there is enough space and permissions are correct. ","45000"},
+        		{"XCW00","Unsupported upgrade from '{0}' to '{1}'.","45000"},
+        		{"XJ004","Database '{0}' not found.","40000"},
+        		{"XJ015","Derby system shutdown.","50000"},
+        		{"XJ028","The URL '{0}' is not properly formed.","40000"},
+        		{"XJ040","Failed to start database '{0}', see the next exception for details.","40000"},
+        		{"XJ041","Failed to create database '{0}', see the next exception for details.","40000"},
+        		{"XJ049","Conflicting create attributes specified.","40000"},
+        		{"XJ05B","JDBC attribute '{0}' has an invalid value '{1}', valid values are '{2}'.","40000"},
+        		{"XJ081","Conflicting create/restore/recovery attributes specified.","40000"},
+        		{"XJ213","The traceLevel connection property does not have a valid format for a number.","40000"},
+        		{"XSDB0","Unexpected exception on in-memory page {0}","45000"},
+        		{"XSDB1","Unknown page format at page {0}","45000"},
+        		{"XSDB2","Unknown container format at container {0} : {1}","45000"},
+        		{"XSDB3","Container information cannot change once written: was {0}, now {1}","45000"},
+        		{"XSDB4","Page {0} is at version {1}, the log file contains change version {2}, either there are log records of this page missing, or this page did not get written out to disk properly.","45000"},
+        		{"XSDB5","Log has change record on page {0}, which is beyond the end of the container.","45000"},
+        		{"XSDB6","Another instance of Derby may have already booted the database {0}.","45000"},
+        		{"XSDB7","WARNING: Derby (instance {0}) is attempting to boot the database {1} even though Derby (instance {2}) may still be active.  Only one instance of Derby should boot a database at a time. Severe and non-recoverable corruption can result and may have already occurred.","45000"},
+        		{"XSDB8","WARNING: Derby (instance {0}) is attempting to boot the database {1} even though Derby (instance {2}) may still be active.  Only one instance of Derby should boot a database at a time. Severe and non-recoverable corruption can result if 2 instances of Derby boot on the same database at the same time.  The db2j.database.forceDatabaseLock=true property has been set, so the database will not boot until the db.lck is no longer present.  Normally this file is removed when the first instance of Derby to boot on the database exits, but it may be left behind in some shutdowns.  It will be necessary to remove the file by hand in that case.  It is important to verify that no other VM is accessing the database before deleting the db.lck file by hand.","45000"},
+        		{"XSDB9","Stream container {0} is corrupt.","45000"},
+        		{"XSDBA","Attempt to allocate object {0} failed.","45000"},
+        		{"XSDBB",">Another instance of Derby within the same JVM may have already booted the database {0}. Only a single classloader within the same JVM can boot the database.","45000"},
+        		{"XSDBC","WARNING: {0}. Derby cannot acess  the system property derby.storage.jvmInstanceId. This permission is necessary for Derby to detect multiple Classloader boot of the database.  Without this permission corruption could occur. Add the permission permission: java.util.PropertyPermision \"derby.storage.jvmInstanceId\", \"read,write\"  to your policy file. ","45000"},
+        		{"XSDG0","Page {0} could not be read from disk.","45000"},
+        		{"XSDG1","Page {0} could not be written to disk, please check if disk is full.","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"},
+        		{"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"},
+        		{"XSDG8","Unable to copy directory '{0}' to '{1}' during restore. Please make sure that there is enough space and permissions are correct. ","45000"},
+        		{"XSLA0","Cannot flush the log file to disk {0}.","45000"},
+        		{"XSLA1","Log Record has been sent to the stream, but it cannot be applied to the store (Object {0}).  This may cause recovery problems also.","45000"},
+        		{"XSLA2","System will shutdown, got I/O Exception while accessing log file.","45000"},
+        		{"XSLA3","Log Corrupted, has invalid data in the log stream.","45000"},
+        		{"XSLA4","Cannot write to the log, most likely the log is full.  Please delete unnecessary files.  It is also possible that the file system is read only, or the disk has failed, or some other problems with the media.  ","45000"},
+        		{"XSLA5","Cannot read log stream for some reason to rollback transaction {0}.","45000"},
+        		{"XSLA6","Cannot recover the database.","45000"},
+        		{"XSLA7","Cannot redo operation {0} in the log.","45000"},
+        		{"XSLA8","Cannot rollback transaction {0}, trying to compensate {1} operation with {2}","45000"},
+        		{"XSLAA","The store has been marked for shutdown by an earlier exception.","45000"},
+        		{"XSLAB","Cannot find log file {0}, please make sure your logDevice property is properly set with the correct path separator for your platform.","45000"},
+        		{"XSLAC","Database at {0} have incompatible format with the current version of software, it may have been created by or upgraded by a later version.","45000"},
+        		{"XSLAD","log Record at instant {2} in log file {3} corrupted. Expected log record length {0}, real length {1}.","45000"},
+        		{"XSLAE","Control file at {0} cannot be written or updated.","45000"},
+        		{"XSLAF","A Read Only database was created with dirty data buffers.","45000"},
+        		{"XSLAH","A Read Only database is being updated.","45000"},
+        		{"XSLAI","Cannot log the checkpoint log record","45000"},
+        		{"XSLAJ","The logging system has been marked to shut down due to an earlier problem and will not allow any more operations until the system shuts down and restarts.","45000"},
+        		{"XSLAK","Database has exceeded largest log file number {0}.","45000"},
+        		{"XSLAL","log record size {2} exceeded the maximum allowable log file size {3}. Error encountered in log file {0}, position {1}.","45000"},
+        		{"XSLAM","Cannot verify database format at {1} due to IOException.","45000"},
+        		{"XSLAN","Database at {0} has an incompatible format with the current version of the software.  The database was created by or upgraded by version {1}.","45000"},
+        		{"XSLAO","Recovery failed unexpected problem {0}.","45000"},
+        		{"XSLAP","Database at {0} is at version {1}. Beta databases cannot be upgraded,","45000"},
+        		{"XSLAQ","cannot create log file at directory {0}.","45000"},
+        		{"XSLAR","Unable to copy log file '{0}' to '{1}' during restore. Please make sure that there is enough space and permissions are correct. ","45000"},
+        		{"XSLAS","Log directory {0} not found in backup during restore. Please make sure that backup copy is the correct one and it is not corrupted.","45000"},
+        		{"XSLAT","The log directory '{0}' exists. The directory might belong to another database. Check that the location specified for the logDevice attribute is correct.","45000"},
+        		{"XSTB0","An exception was thrown during transaction abort.","50000"},
+        		{"XSTB2","Cannot log transaction changes, maybe trying to write to a read only database.","50000"},
+        		{"XSTB3","Cannot abort transaction because the log manager is null, probably due to an earlier error.","50000"},
+        		{"XSTB5","Creating database with logging disabled encountered unexpected problem.","50000"},
+        		{"XSTB6","Cannot substitute a transaction table with another while one is already in use.","50000"},
+        		{"XXXXX","Normal database session close.","40000"}};
 
+        		        		       	
         JDBC.assertUnorderedResultSet(rs, expectedRows);
         rollback();
         s.close();
     }
 }
+

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/_Suite.java Wed Jun 13 14:56:42 2007
@@ -52,6 +52,7 @@
         TestSuite suite = new TestSuite("store");
         
         suite.addTest(BootAllTest.suite());
+        suite.addTest(ClassLoaderBootTest.suite());
 
         // Encryption only supported for Derby in J2SE/J2EE environments.
         // J2ME (JSR169) does not support encryption.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java Wed Jun 13 14:56:42 2007
@@ -339,6 +339,19 @@
 
 	} // End of releaseExclusiveFileLock
 
+    
+    /**
+     * Return Random Acess file to the lock file, that is used to 
+     * get the exclusing e lock. It can be used  read/write data 
+     * from/to the lock file. 
+     * @return Random access File object used to get the exclusive lock.
+     */
+    public StorageRandomAccessFile getLockedFile() {
+        return realFile.getLockedFile();
+    }
+
+
+
 
     /**
      * Get a random access (read/write) file.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy?view=diff&rev=547042&r1=547041&r2=547042
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy Wed Jun 13 14:56:42 2007
@@ -26,8 +26,10 @@
 //
 grant codeBase "${derbyTesting.codejar}derby.jar" {
   permission java.util.PropertyPermission "derby.*", "read";
+   // needed to prevent intraJVM dual boot.
+  permission java.util.PropertyPermission "derby.storage.jvmInstanceId", "write";
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
-  
+
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
   permission java.util.PropertyPermission "derbyTesting.unittest.*", "write";
@@ -133,7 +135,12 @@
   // the security manager and allow setIO to change the system err and out
   // streams. Currently the nist suite runs with useprocess=false.
   permission java.lang.RuntimePermission "setSecurityManager";
-  permission java.lang.RuntimePermission "setIO"; 
+  permission java.lang.RuntimePermission "setIO";
+
+   // When running ClassLoaderBootTest need to be able to setContextClassLoader
+   // and create a classloader
+   permission java.lang.RuntimePermission "setContextClassLoader";
+   permission java.lang.RuntimePermission "createClassLoader";
 };
 
 //
@@ -142,9 +149,9 @@
 grant codeBase "${derbyTesting.codeclasses}" {
   // Access all properties using System.getProperties
   permission java.util.PropertyPermission "*", "read, write";
-  
   permission java.util.PropertyPermission "derby.*", "read";
   permission java.lang.RuntimePermission "createClassLoader";
+
   permission java.security.SecurityPermission "getPolicy";
    
   permission java.io.FilePermission "${derby.system.home}${/}derby.properties", "read";
@@ -172,6 +179,8 @@
   // streams. Currently the nist suite runs with useprocess=false.
   permission java.lang.RuntimePermission "setSecurityManager";
   permission java.lang.RuntimePermission "setIO"; 
+   // When running ClassLoaderBootTest need to be able to setContextClassLoader
+   permission java.lang.RuntimePermission "setContextClassLoader";
 };
 
 // JUnit jar file tries to read junit.properties in the user's



Mime
View raw message