db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r446700 - in /db/derby/code/branches/10.2: bin/ java/drda/org/apache/derby/impl/drda/ java/engine/org/apache/derby/iapi/store/raw/log/ java/engine/org/apache/derby/impl/store/raw/ java/engine/org/apache/derby/impl/store/raw/log/ java/engine...
Date Fri, 15 Sep 2006 19:27:17 GMT
Author: rhillegas
Date: Fri Sep 15 12:27:15 2006
New Revision: 446700

URL: http://svn.apache.org/viewvc?view=rev&rev=446700
Log:
DERBY-1725: Merge the following patches from the trunk to the 10.2 branch: DERBY-1786 (442647), DERBY-1843 (442646), DERBY-803 (442490), DERBY-1832 (442464), DERBY-1817 (442463, 442462, 441802), DERBY-1691 (442199), DERBY-1767 (441789), DERBY-1675 (441779).

Removed:
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk15/blobclob4BLOB.out
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ver2.6/blobclob4BLOB.out
Modified:
    db/derby/code/branches/10.2/bin/NetworkServerControl.bat
    db/derby/code/branches/10.2/bin/dblook.bat
    db/derby/code/branches/10.2/bin/ij.bat
    db/derby/code/branches/10.2/bin/startNetworkServer.bat
    db/derby/code/branches/10.2/bin/stopNetworkServer.bat
    db/derby/code/branches/10.2/bin/sysinfo.bat
    db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/ClientThread.java
    db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/store/raw/log/LogFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/RawStore.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/ReadOnly.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/loc/messages_en.properties
    db/derby/code/branches/10.2/java/shared/org/apache/derby/shared/common/reference/SQLState.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.policy
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties.policy
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java

Modified: db/derby/code/branches/10.2/bin/NetworkServerControl.bat
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/bin/NetworkServerControl.bat?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/bin/NetworkServerControl.bat (original)
+++ db/derby/code/branches/10.2/bin/NetworkServerControl.bat Fri Sep 15 12:27:15 2006
@@ -17,7 +17,7 @@
 @REM specific language governing permissions and limitations
 @REM under the License.
 
-CALL %~dp0derby_common.bat
+CALL %~dp0derby_common.bat %*
 
 if "%_USE_CLASSPATH%"=="no" goto runNoClasspath
 if not "%CLASSPATH%"=="" goto runWithClasspath

Modified: db/derby/code/branches/10.2/bin/dblook.bat
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/bin/dblook.bat?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/bin/dblook.bat (original)
+++ db/derby/code/branches/10.2/bin/dblook.bat Fri Sep 15 12:27:15 2006
@@ -17,7 +17,7 @@
 @REM specific language governing permissions and limitations
 @REM under the License.
 
-CALL %~dp0derby_common.bat
+CALL %~dp0derby_common.bat %*
 
 if "%_USE_CLASSPATH%"=="no" goto runNoClasspath
 if not "%CLASSPATH%"=="" goto runWithClasspath

Modified: db/derby/code/branches/10.2/bin/ij.bat
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/bin/ij.bat?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/bin/ij.bat (original)
+++ db/derby/code/branches/10.2/bin/ij.bat Fri Sep 15 12:27:15 2006
@@ -17,7 +17,7 @@
 @REM specific language governing permissions and limitations
 @REM under the License.
 
-CALL %~dp0derby_common.bat
+CALL %~dp0derby_common.bat %*
 
 if "%_USE_CLASSPATH%"=="no" goto runNoClasspath
 if not "%CLASSPATH%"=="" goto runWithClasspath

Modified: db/derby/code/branches/10.2/bin/startNetworkServer.bat
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/bin/startNetworkServer.bat?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/bin/startNetworkServer.bat (original)
+++ db/derby/code/branches/10.2/bin/startNetworkServer.bat Fri Sep 15 12:27:15 2006
@@ -17,7 +17,7 @@
 @REM specific language governing permissions and limitations
 @REM under the License.
 
-CALL %~dp0derby_common.bat
+CALL %~dp0derby_common.bat %*
 
 if "%_USE_CLASSPATH%"=="no" goto runNoClasspath
 if not "%CLASSPATH%"=="" goto runWithClasspath

Modified: db/derby/code/branches/10.2/bin/stopNetworkServer.bat
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/bin/stopNetworkServer.bat?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/bin/stopNetworkServer.bat (original)
+++ db/derby/code/branches/10.2/bin/stopNetworkServer.bat Fri Sep 15 12:27:15 2006
@@ -17,7 +17,7 @@
 @REM specific language governing permissions and limitations
 @REM under the License.
 
-CALL %~dp0derby_common.bat
+CALL %~dp0derby_common.bat %*
 
 if "%_USE_CLASSPATH%"=="no" goto runNoClasspath
 if not "%CLASSPATH%"=="" goto runWithClasspath

Modified: db/derby/code/branches/10.2/bin/sysinfo.bat
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/bin/sysinfo.bat?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/bin/sysinfo.bat (original)
+++ db/derby/code/branches/10.2/bin/sysinfo.bat Fri Sep 15 12:27:15 2006
@@ -17,7 +17,7 @@
 @REM specific language governing permissions and limitations
 @REM under the License.
 
-CALL %~dp0derby_common.bat
+CALL %~dp0derby_common.bat %*
 
 if "%_USE_CLASSPATH%"=="no" goto runNoClasspath
 if not "%CLASSPATH%"=="" goto runWithClasspath

Modified: db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/ClientThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/ClientThread.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/ClientThread.java (original)
+++ db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/ClientThread.java Fri Sep 15 12:27:15 2006
@@ -47,7 +47,6 @@
 		{
 
 			Socket clientSocket = null;
-			Session clientSession = null;
 
 
 			for (;;)
@@ -77,38 +76,10 @@
 					} else throw e1;
 	                		break;
 				} // end priv try/catch block
-				
-				connNum = parent.getNewConnNum();
-                                if (parent.getLogConnections())
-                                    parent.consolePropertyMessage("DRDA_ConnNumber.I", 
-							Integer.toString(connNum));
 
 				//create a new Session for this session
-				// Note that we always re-fetch the tracing
-				// configuration from the parent, because it
-				// may have changed (there are administrative
-				// commands which allow dynamic tracing
-				// reconfiguration).
-				clientSession = new Session(connNum, clientSocket, 
-					parent.getTraceDirectory(),
-					parent.getTraceAll());
+				parent.addSession(clientSocket);
 
-				//add to Session list
-				parent.addToSessionTable(new Integer(connNum), clientSession);
-
-				//create a new thread for this connection if we need one
-				//and if we are allowed
-				if (parent.getFreeThreads() == 0 && 
-					(parent.getMaxThreads() == 0  || 
-					parent.getThreadList().size() < parent.getMaxThreads()))
-				{
-					DRDAConnThread thread = new DRDAConnThread(clientSession, 
-						parent, timeSlice, parent.getLogConnections());
-					parent.getThreadList().addElement(thread);
-					thread.start();
-				}
-				else //wait for a free thread
-					parent.runQueueAdd(clientSession);
 				}catch (Exception e) {
 					if (e instanceof InterruptedException)
 						return;

Modified: db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Fri Sep 15 12:27:15 2006
@@ -292,7 +292,7 @@
 		}
 		if (SanityManager.DEBUG)
 			trace("Ending connection thread");
-		server.getThreadList().removeElement(this);
+		server.removeThread(this);
 
 	}
 	/**

Modified: db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java (original)
+++ db/derby/code/branches/10.2/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java Fri Sep 15 12:27:15 2006
@@ -297,11 +297,19 @@
 	// databases it has booted.
 	private boolean shutdownDatabasesOnShutdown = false;
 	
-    // Sun JCE does not have support for EUSRIDPWD, whereas
-    // most versions of IBM JCE have support for this.  Hence
-    // find out if the server can support EUSRIDPWD.
+    /**
+     * Can EUSRIDPWD security mechanism be used with 
+     * the current JVM
+     */
     private static boolean SUPPORTS_EUSRIDPWD = false;
 
+    /*
+     * DRDA Specification for the EUSRIDPWD security mechanism
+     * requires DH algorithm support with a 32-byte prime to be
+     * used. Not all JCE implementations have support for this.
+     * Hence here we need to find out if EUSRIDPWD can be used
+     * with the current JVM.
+     */ 
     static
     {
         try
@@ -1848,7 +1856,7 @@
 	 *
 	 * @param clientSession	session needing work
 	 */
-	protected void runQueueAdd(Session clientSession)
+	private void runQueueAdd(Session clientSession)
 	{
 		synchronized(runQueue)
 		{
@@ -2603,16 +2611,16 @@
     }
    
     /**
-     * EUSRIDPWD support depends on the availability of the
-     * algorithm in the JCE implementation in the classpath 
-     * of the server. At runtime, information about this 
-     * capability is figured out.  
-     * @return whether EUSRIDPWD is supported or not
-     */
+     * This method returns whether EUSRIDPWD security mechanism
+     * is supported or not. See class static block for more
+     * info.
+     * @return true if EUSRIDPWD is supported, false otherwise
+     */ 
     boolean supportsEUSRIDPWD()
     {
         return SUPPORTS_EUSRIDPWD;
     }
+    
 	/**
 	 * Get integer property values
 	 *
@@ -3086,7 +3094,7 @@
 	 *
 	 * @return value of maximum number of threads
 	 */
-	protected int getMaxThreads()
+	private int getMaxThreads()
 	{
 		synchronized(threadsSync) {
 			return maxThreads;
@@ -3364,52 +3372,79 @@
 
 
 	/**
-	 * Add To Session Table - for use by ClientThread, add a new Session to the sessionTable.
+	 * Add a session - for use by <code>ClientThread</code>. Put the session
+	 * into the session table and the run queue. Start a new
+	 * <code>DRDAConnThread</code> if there are more sessions waiting than
+	 * there are free threads, and the maximum number of threads is not
+	 * exceeded.
 	 *
-	 * @param i	Connection number to register
-	 * @param s	Session to add to the sessionTable
-	 */
-	protected void addToSessionTable(Integer i, Session s)
-	{
-		sessionTable.put(i, s);
-	}
-
-	/**
-	 * Get New Conn Num - for use by ClientThread, generate a new connection number for the attempted Session.
+	 * <p><code>addSession()</code> should only be called from one thread at a
+	 * time.
 	 *
-	 * @return	a new connection number
+	 * @param clientSocket the socket to read from and write to
 	 */
-	protected int getNewConnNum()
-	{
-		return ++connNum;
-	}
+	void addSession(Socket clientSocket) throws Exception {
 
+		int connectionNumber = ++connNum;
 
-	/**
-	 * Get Free Threads - for use by ClientThread, get the number of 
-	 * free threads in order to determine if
-	 * a new thread can be run.
-	 *
-	 * @return	the number of free threads
-	 */
-	protected int getFreeThreads()
-	{
-		synchronized(runQueue)
-		{
-			return freeThreads;
+		if (getLogConnections()) {
+			consolePropertyMessage("DRDA_ConnNumber.I",
+								   Integer.toString(connectionNumber));
+		}
+
+		// Note that we always re-fetch the tracing configuration because it
+		// may have changed (there are administrative commands which allow
+		// dynamic tracing reconfiguration).
+		Session session = new Session(connectionNumber, clientSocket,
+									  getTraceDirectory(), getTraceAll());
+
+		sessionTable.put(new Integer(connectionNumber), session);
+
+		// Check whether there are enough free threads to service all the
+		// threads in the run queue in addition to the newly added session.
+		boolean enoughThreads;
+		synchronized (runQueue) {
+			enoughThreads = (runQueue.size() < freeThreads);
+		}
+		// No need to hold the synchronization on runQueue any longer than
+		// this. Since no other threads can make runQueue grow, and no other
+		// threads will reduce the number of free threads without removing
+		// sessions from runQueue, (runQueue.size() < freeThreads) cannot go
+		// from true to false until addSession() returns.
+
+		DRDAConnThread thread = null;
+
+		// try to start a new thread if we don't have enough free threads
+		if (!enoughThreads) {
+			// Synchronize on threadsSync to ensure that the value of
+			// maxThreads doesn't change until the new thread is added to
+			// threadList.
+			synchronized (threadsSync) {
+				// only start a new thread if we have no maximum number of
+				// threads or the maximum number of threads is not exceeded
+				if ((maxThreads == 0) || (threadList.size() < maxThreads)) {
+					thread = new DRDAConnThread(session, this, getTimeSlice(),
+												getLogConnections());
+					threadList.add(thread);
+					thread.start();
+				}
+			}
+		}
+
+		// add the session to the run queue if we didn't start a new thread
+		if (thread == null) {
+			runQueueAdd(session);
 		}
 	}
 
 	/**
-	 * Get Thread List - for use by ClientThread, get the thread list 
-	 * Vector so that a newly spawned thread
-	 * can be run and added to the ThreadList from the ClientThread 
+	 * Remove a thread from the thread list. Should be called when a
+	 * <code>DRDAConnThread</code> has been closed.
 	 *
-	 * @return	the threadList Vector
+	 * @param thread the closed thread
 	 */
-	protected Vector getThreadList()
-	{
-		return threadList;
+	void removeThread(DRDAConnThread thread) {
+		threadList.remove(thread);
 	}
 	
 	protected Object getShutdownSync() { return shutdownSync; } 

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/store/raw/log/LogFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/store/raw/log/LogFactory.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/store/raw/log/LogFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/store/raw/log/LogFactory.java Fri Sep 15 12:27:15 2006
@@ -284,9 +284,16 @@
 
     /*
      * Set that the database is encrypted , all the transaction log has 
-     * to be encrypted.
+     * to be encrypted, and flush the log if requesed. Log needs to 
+	 * be flushed  first, if this is  being set during (re) encryption 
+	 * of an existing  database. 
+	 *
+	 * @param flushLog  true, if log needs to be flushed, 
+	 *                  otherwise false.  
      */
-    public void setDatabaseEncrypted();
+    public  void setDatabaseEncrypted(boolean flushLog)
+		throws StandardException;
+
     
     /*
      * set up a new log file to start writing 

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/RawStore.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/RawStore.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/RawStore.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/RawStore.java Fri Sep 15 12:27:15 2006
@@ -302,7 +302,7 @@
 
         if (databaseEncrypted) {
             // let log factory know if the database is encrypted . 
-            logFactory.setDatabaseEncrypted();
+            logFactory.setDatabaseEncrypted(false);
             // let data factory know if the database is encrypted. 
             dataFactory.setDatabaseEncrypted();
         }
@@ -1398,7 +1398,8 @@
      * when the input debug flag is set, an expception 
      * is throw when run in the debug mode.
      */
-    private void crashOnDebugFlag(String debugFlag) 
+    private void crashOnDebugFlag(String debugFlag, 
+                                  boolean reEncrypt) 
         throws StandardException
     {
         if (SanityManager.DEBUG)
@@ -1407,11 +1408,12 @@
             // exception to simulate error cases.
             if (SanityManager.DEBUG_ON(debugFlag))
             {
-                StandardException se= StandardException.newException(
-                       SQLState.LOG_IO_ERROR, 
-                       new IOException(debugFlag));
-                markCorrupt(se);
-                throw se;
+               StandardException se = StandardException.newException(
+                                      (reEncrypt ? SQLState.DATABASE_REENCRYPTION_FAILED :
+                                      SQLState.DATABASE_ENCRYPTION_FAILED),
+                                      debugFlag);
+               markCorrupt(se);
+               throw se;
             }
         }
     }
@@ -1488,178 +1490,202 @@
                    this,
                     ContextService.getFactory().getCurrentContextManager(),
                     AccessFactoryGlobals.USER_TRANS_NAME);
-        boolean error = true;
-        try {
+
+        try 
+		{
+			
             dataFactory.encryptAllContainers(transaction);
-            error = false;
-        }finally {
+
+            // all the containers are (re) encrypted, now mark the database as
+            // encrypted if a plain database is getting configured for encryption
+            // or update the encryption the properties, in the 
+            // service.properties ..etc.
+
             
-            // if (re) encryption failed, abort the transaction.
-            if (error) { 
-                transaction.abort();
-            }
-            else {
-
-                // (re) encryption of all the containers is complete 
-                // update the encryption properties in the 
-                // service.properties ..etc.
+            if (SanityManager.DEBUG) {
+                crashOnDebugFlag(TEST_REENCRYPT_CRASH_BEFORE_COMMT, reEncrypt);
+            }
 
-                if (SanityManager.DEBUG) {
-                    crashOnDebugFlag(TEST_REENCRYPT_CRASH_BEFORE_COMMT);
-                }
+            // check if the checkpoint is currently in the last log file, 
+            // otherwise force a checkpoint and then do a log switch, 
+            // after setting up a new encryption key
+            if (!logFactory.isCheckpointInLastLogFile()) 
+            {
+                // perfrom a checkpoint, this is a reference checkpoint 
+                // to find if the re(encryption) is complete. 
+                logFactory.checkpoint(this, dataFactory, xactFactory, true);
+            }
                 
-                // let the log factory and data factory know that 
-                // database is encrypted.
-                if (!reEncrypt) {
-                    // mark in the raw store that the database is 
-                    // encrypted. 
-                    encryptDatabase = false;
-                    databaseEncrypted = true;
-                    dataFactory.setDatabaseEncrypted();
-                    logFactory.setDatabaseEncrypted();
 
+            encryptDatabase = false;
 
-                } else {
-                    // switch the encryption/decryption engine to the new ones.
-                    decryptionEngine = newDecryptionEngine;  
-                    encryptionEngine = newEncryptionEngine;
-                    currentCipherFactory = newCipherFactory;
-                }
+            // let the log factory know that database is 
+            // (re) encrypted and ask it to flush the log, 
+            // before enabling encryption of the log with 
+            // the new key.
+            logFactory.setDatabaseEncrypted(true);
+            
+            // let the log factory and data factory know that 
+            // database is encrypted.
+            if (!reEncrypt) {
+                // mark in the raw store that the database is 
+                // encrypted. 
+                databaseEncrypted = true;
+                dataFactory.setDatabaseEncrypted();
+            } else {
+                // switch the encryption/decryption engine to the new ones.
+                decryptionEngine = newDecryptionEngine;  
+                encryptionEngine = newEncryptionEngine;
+                currentCipherFactory = newCipherFactory;
+            }
 
-  
-                // make the log factory ready to encrypt
-                // the transaction log with the new encryption 
-                // key by switching to a new log file. 
-                // If re-encryption is aborted for any reason, 
-                // this new log file will be deleted, during
-                // recovery.
-
-                logFactory.startNewLogFile();
-
-                // mark that re-encryption is in progress in the 
-                // service.properties, so that (re) encryption 
-                // changes that can not be undone using the transaction 
-                // log can be un-done before recovery starts.
-                // (like the changes to service.properties and 
-                // any log files the can not be understood by the
-                // old encryption key), incase engine crashes
-                // after this point. 
-
-                // if the crash occurs before this point, recovery
-                // will rollback the changes using the transaction 
-                // log.
+            
+            // make the log factory ready to encrypt
+            // the transaction log with the new encryption 
+            // key by switching to a new log file. 
+            // If re-encryption is aborted for any reason, 
+            // this new log file will be deleted, during
+            // recovery.
+
+            logFactory.startNewLogFile();
+
+            // mark that re-encryption is in progress in the 
+            // service.properties, so that (re) encryption 
+            // changes that can not be undone using the transaction 
+            // log can be un-done before recovery starts.
+            // (like the changes to service.properties and 
+            // any log files the can not be understood by the
+            // old encryption key), incase engine crashes
+            // after this point. 
+
+            // if the crash occurs before this point, recovery
+            // will rollback the changes using the transaction 
+            // log.
 
-                properties.put(RawStoreFactory.DB_ENCRYPTION_STATUS,
-                               String.valueOf(
+            properties.put(RawStoreFactory.DB_ENCRYPTION_STATUS,
+                           String.valueOf(
                                RawStoreFactory.DB_ENCRYPTION_IN_PROGRESS));
 
-                if (reEncrypt) 
-                {
-                    // incase re-encryption, save the old 
-                    // encryption related properties, before
-                    // doing updates with new values.
+            if (reEncrypt) 
+            {
+                // incase re-encryption, save the old 
+                // encryption related properties, before
+                // doing updates with new values.
 
-                    if (externalKeyEncryption) 
-                    {
-                        // save the current copy of verify key file.
-                        StorageFile verifyKeyFile = 
-                            storageFactory.newStorageFile(
+                if (externalKeyEncryption) 
+                {
+                    // save the current copy of verify key file.
+                    StorageFile verifyKeyFile = 
+                        storageFactory.newStorageFile(
                                  Attribute.CRYPTO_EXTERNAL_KEY_VERIFY_FILE);
-                        StorageFile oldVerifyKeyFile = 
-                          storageFactory.newStorageFile(
+                    StorageFile oldVerifyKeyFile = 
+                        storageFactory.newStorageFile(
                           RawStoreFactory.CRYPTO_OLD_EXTERNAL_KEY_VERIFY_FILE);
 
-                        if(!privCopyFile(verifyKeyFile, oldVerifyKeyFile))
-                            throw StandardException.
-                              newException(SQLState.RAWSTORE_ERROR_COPYING_FILE,
-                                           verifyKeyFile, oldVerifyKeyFile); 
-
-                        // update the verify key file with the new key info.
-                        currentCipherFactory.verifyKey(reEncrypt, 
-                                                       storageFactory, 
-                                                       properties);
-                    } else 
-                    {
-                        // save the current generated encryption key 
-                        String keyString = 
-                            properties.getProperty(
-                                           RawStoreFactory.ENCRYPTED_KEY);
-                        if (keyString != null)
-                            properties.put(RawStoreFactory.OLD_ENCRYPTED_KEY,
-                                           keyString);
-                    }
+                    if(!privCopyFile(verifyKeyFile, oldVerifyKeyFile))
+                        throw StandardException.
+                            newException(SQLState.RAWSTORE_ERROR_COPYING_FILE,
+                                         verifyKeyFile, oldVerifyKeyFile); 
+
+                    // update the verify key file with the new key info.
+                    currentCipherFactory.verifyKey(reEncrypt, 
+                                                   storageFactory, 
+                                                   properties);
                 } else 
                 {
-                    // save the encryption block size;
-                    properties.put(RawStoreFactory.ENCRYPTION_BLOCKSIZE,
-                                   String.valueOf(encryptionBlockSize));
+                    // save the current generated encryption key 
+                    String keyString = 
+                        properties.getProperty(
+                                               RawStoreFactory.ENCRYPTED_KEY);
+                    if (keyString != null)
+                        properties.put(RawStoreFactory.OLD_ENCRYPTED_KEY,
+                                       keyString);
                 }
+            } else 
+            {
+                // save the encryption block size;
+                properties.put(RawStoreFactory.ENCRYPTION_BLOCKSIZE,
+                               String.valueOf(encryptionBlockSize));
+            }
 
-                // save the new encryption properties into service.properties
-                currentCipherFactory.saveProperties(properties) ;
+            // save the new encryption properties into service.properties
+            currentCipherFactory.saveProperties(properties) ;
  
-                if (SanityManager.DEBUG) {
-                    crashOnDebugFlag(
-                                 TEST_REENCRYPT_CRASH_AFTER_SWITCH_TO_NEWKEY);
-                }
+            if (SanityManager.DEBUG) {
+                crashOnDebugFlag(
+                                 TEST_REENCRYPT_CRASH_AFTER_SWITCH_TO_NEWKEY,
+                                 reEncrypt);
+            }
 
-                // commit the transaction that is used to 
-                // (re) encrypt the database. Note that 
-                // this will be logged with newly generated 
-                // encryption key in the new log file created 
-                // above.
-                transaction.commit();
+            // commit the transaction that is used to 
+            // (re) encrypt the database. Note that 
+            // this will be logged with newly generated 
+            // encryption key in the new log file created 
+            // above.
+            transaction.commit();
 
-                if (SanityManager.DEBUG) {
-                    crashOnDebugFlag(TEST_REENCRYPT_CRASH_AFTER_COMMT);
-                }
+            if (SanityManager.DEBUG) {
+                crashOnDebugFlag(TEST_REENCRYPT_CRASH_AFTER_COMMT, 
+                                 reEncrypt);
+            }
 
-                // force the checkpoint with new encryption key.
-                logFactory.checkpoint(this, dataFactory, xactFactory, true);
+            // force the checkpoint with new encryption key.
+            logFactory.checkpoint(this, dataFactory, xactFactory, true);
 
-                if (SanityManager.DEBUG) {
-                    crashOnDebugFlag(TEST_REENCRYPT_CRASH_AFTER_CHECKPOINT);
-                }
+            if (SanityManager.DEBUG) {
+                crashOnDebugFlag(TEST_REENCRYPT_CRASH_AFTER_CHECKPOINT, 
+                                 reEncrypt);
+            }
 
-                // once the checkpont makes it to the log, re-encrption 
-                // is complete. only cleanup is remaining ; update the 
-                // re-encryption status flag to cleanup. 
-                properties.put(RawStoreFactory.DB_ENCRYPTION_STATUS,
-                               String.valueOf(
+            // once the checkpont makes it to the log, re-encrption 
+            // is complete. only cleanup is remaining ; update the 
+            // re-encryption status flag to cleanup. 
+            properties.put(RawStoreFactory.DB_ENCRYPTION_STATUS,
+                           String.valueOf(
                                RawStoreFactory.DB_ENCRYPTION_IN_CLEANUP));
 
-                // database is (re)encrypted successfuly, 
-                // remove the old version of the container files.
-                dataFactory.removeOldVersionOfContainers(false);
+            // database is (re)encrypted successfuly, 
+            // remove the old version of the container files.
+            dataFactory.removeOldVersionOfContainers(false);
                 
-                if (reEncrypt) 
+            if (reEncrypt) 
+            {
+                if (externalKeyEncryption)
                 {
-                    if (externalKeyEncryption)
-                    {
-                        // remove the saved copy of the verify.key file
-                        StorageFile oldVerifyKeyFile = 
+                    // remove the saved copy of the verify.key file
+                    StorageFile oldVerifyKeyFile = 
                         storageFactory.newStorageFile(
-                        RawStoreFactory.CRYPTO_OLD_EXTERNAL_KEY_VERIFY_FILE);
-                        if (!privDelete(oldVerifyKeyFile))
-                            throw StandardException.newException(
+                          RawStoreFactory.CRYPTO_OLD_EXTERNAL_KEY_VERIFY_FILE);
+                    if (!privDelete(oldVerifyKeyFile))
+                        throw StandardException.newException(
                                     SQLState.UNABLE_TO_DELETE_FILE, 
                                     oldVerifyKeyFile);
-                    } else 
-                    {
-                        // remove the old encryption key property.
-                        properties.remove(RawStoreFactory.OLD_ENCRYPTED_KEY);
-                    }
+                } else 
+                {
+                    // remove the old encryption key property.
+                    properties.remove(RawStoreFactory.OLD_ENCRYPTED_KEY);
                 }
+            }
 
-                // (re) encrypion is done,  remove the (re) 
-                // encryption status property. 
-                properties.remove(RawStoreFactory.DB_ENCRYPTION_STATUS);
+            // (re) encrypion is done,  remove the (re) 
+            // encryption status property. 
 
-            }                
+            properties.remove(RawStoreFactory.DB_ENCRYPTION_STATUS);
+
+            // close the transaction. 
+            transaction.close(); 
 
+        } catch (StandardException se) {
+
+            throw StandardException.newException(
+                      (reEncrypt ? SQLState.DATABASE_REENCRYPTION_FAILED :
+                      SQLState.DATABASE_ENCRYPTION_FAILED),
+                      se,
+                      se.getMessage()); 
+        } finally {
+            // clear the new encryption engines.
             newDecryptionEngine = null;   
             newEncryptionEngine = null;
-            transaction.close(); 
         }
     }
 
@@ -1741,7 +1767,8 @@
                 
             if (SanityManager.DEBUG) {
                 crashOnDebugFlag(
-                   TEST_REENCRYPT_CRASH_AFTER_RECOVERY_UNDO_LOGFILE_DELETE);
+                   TEST_REENCRYPT_CRASH_AFTER_RECOVERY_UNDO_LOGFILE_DELETE, 
+                   reEncryption);
             }
 
             // Note : If a crash occurs at this point, then on reboot 
@@ -1825,7 +1852,8 @@
 
             if (SanityManager.DEBUG) {
                 crashOnDebugFlag(
-                    TEST_REENCRYPT_CRASH_AFTER_RECOVERY_UNDO_REVERTING_KEY);
+                    TEST_REENCRYPT_CRASH_AFTER_RECOVERY_UNDO_REVERTING_KEY, 
+                    reEncryption);
             }
 
         } // end of UNDO
@@ -1839,7 +1867,8 @@
         
         if (SanityManager.DEBUG) {
                 crashOnDebugFlag(
-                   TEST_REENCRYPT_CRASH_BEFORE_RECOVERY_FINAL_CLEANUP);
+                   TEST_REENCRYPT_CRASH_BEFORE_RECOVERY_FINAL_CLEANUP, 
+                   reEncryption);
         }
 
         // either the (re) encryption was complete , 

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java Fri Sep 15 12:27:15 2006
@@ -3973,11 +3973,19 @@
 
 
     /*
-     * Set that the database is encrypted, all the data in the 
-     * transaction log  should be encrypted. 
+     * Set that the database is encrypted , all the transaction log has 
+     * to be encrypted, and flush the log if requesed. Log needs to 
+     * be flushed  first, if this is  being set during (re) encryption 
+     * of an existing  database. 
+     *
+     * @param flushLog  true, if log needs to be flushed, 
+     *                  otherwise false.  
      */
-    public  void setDatabaseEncrypted() 
+    public  void setDatabaseEncrypted(boolean flushLog) 
+        throws StandardException
     {
+        if (flushLog) 
+            flushAll();
         databaseEncrypted = true;
     }
 

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/ReadOnly.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/ReadOnly.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/ReadOnly.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/store/raw/log/ReadOnly.java Fri Sep 15 12:27:15 2006
@@ -360,7 +360,7 @@
      * Set that the database is encrypted. Read-only database can not 
      * be reencrypted, nothing to do in this case. 
      */
-    public void setDatabaseEncrypted()
+    public void setDatabaseEncrypted(boolean flushLog)
     {
         // nothing to do for a read-only database.
     }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/loc/messages_en.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/loc/messages_en.properties?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/loc/messages_en.properties (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/loc/messages_en.properties Fri Sep 15 12:27:15 2006
@@ -102,13 +102,14 @@
 XBCXL.S=The verification process for the encryption key was not successful. This could have been caused by an error when accessing the appropriate file to do the verification process.  See next exception for details.  
 XBCXM.S=The length of the external encryption key must be an even number.
 XBCXN.S=The external encryption key contains one or more illegal characters. Allowed characters for a hexadecimal number are 0-9, a-f and A-F.
-XBCXO.S= Cannot encrypt the database when there is a global transaction in the prepared state.
-XBCXP.S= Cannot re-encrypt the database with a new boot password or an external encryption key when there is a global transaction in the prepared state.
-XBCXQ.S= Cannot configure a read-only database for encryption.
-XBCXR.S= Cannot re-encrypt a read-only database with a new boot password or an external encryption key .
-XBCXS.S= Cannot configure a database for encryption, when database is in the log archive mode.
-XBCXT.S= Cannot re-encrypt a database with a new boot password or an external encryption key, when database is in the log archive mode.
-
+XBCXO.S=Cannot encrypt the database when there is a global transaction in the prepared state.
+XBCXP.S=Cannot re-encrypt the database with a new boot password or an external encryption key when there is a global transaction in the prepared state.
+XBCXQ.S=Cannot configure a read-only database for encryption.
+XBCXR.S=Cannot re-encrypt a read-only database with a new boot password or an external encryption key .
+XBCXS.S=Cannot configure a database for encryption, when database is in the log archive mode.
+XBCXT.S=Cannot re-encrypt a database with a new boot password or an external encryption key, when database is in the log archive mode.
+XBCXU.S=Encryption of an un-encrypted database failed: {0}.
+XBCXV.S=Encryption of an encrypted database with a new key or a new password failed: {0}.
 
 #../java/com/ibm/db2j/impl/BasicServices/CacheService/Generic/messages.properties
 

Modified: db/derby/code/branches/10.2/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/shared/org/apache/derby/shared/common/reference/SQLState.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/shared/org/apache/derby/shared/common/reference/SQLState.java (original)
+++ db/derby/code/branches/10.2/java/shared/org/apache/derby/shared/common/reference/SQLState.java Fri Sep 15 12:27:15 2006
@@ -229,7 +229,8 @@
     String CANNOT_REENCRYPT_READONLY_DATABASE         = "XBCXR.S";
     String CANNOT_ENCRYPT_LOG_ARCHIVED_DATABASE       = "XBCXS.S";
     String CANNOT_REENCRYPT_LOG_ARCHIVED_DATABASE     = "XBCXT.S";
-
+    String DATABASE_ENCRYPTION_FAILED                 = "XBCXU.S";
+    String DATABASE_REENCRYPTION_FAILED               = "XBCXV.S";
 
 	/*
 	** Cache Service

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude (original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude Fri Sep 15 12:27:15 2006
@@ -15,7 +15,6 @@
 #           regardless of framework
 # excluding largedata/LobLimits.java to run with the network server because currently lobs are materialized and this test tests for 2G lobs.
 # 			see DERBY-326 and DERBY-550 issues
-# excluding jdbcapi/UpdatableResultSetTest.java - Test fails with JCC
 jdbcapi/resultsetStream.java
 lang/errorStream.java
 lang/scrollCursors2.java
@@ -43,7 +42,3 @@
 # Excluding ResultSetClose test since an exception in a statement results in all
 # the result sets associated with the connection closing
 jdbcapi/ResultSetCloseTest.junit
-# DERBY-1691: when run against JCC, exceptions in blobclob4BLOB can appear in
-# different places in the output.
-jdbcapi/blobclob4BLOB.java
-jdbcapi/UpdatableResultSetTest.junit

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall (original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall Fri Sep 15 12:27:15 2006
@@ -22,4 +22,3 @@
 jdbcapi/Stream.java
 jdbcapi/SURTest_ij.sql
 jdbcapi/_Suite.junit
-jdbcapi/UpdatableResultSetTest.junit

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java (original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java Fri Sep 15 12:27:15 2006
@@ -634,6 +634,13 @@
             System.out.println( "  Connection close failed:");
             System.out.println( "    " + sqle.getMessage());
         }
+        // DERBY-803: Give the server threads time to finish their close
+        // operations before we shut down the engine. Otherwise, we might get
+        // some (harmless) error messages printed to the console. See also
+        // DERBY-1020.
+        try {
+            Thread.sleep(5000);
+        } catch (InterruptedException ex) {}
         try
         {
             DriverManager.getConnection( "jdbc:derby:;shutdown=true");

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.policy
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.policy?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.policy (original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.policy Fri Sep 15 12:27:15 2006
@@ -26,3 +26,9 @@
   //client side: test execs another jvm with relative path
   permission java.io.FilePermission "<<ALL FILES>>", "execute";
 };
+
+// See DERBY-1832
+grant codeBase "${derbyTesting.codejar}/derbyclient.jar" {
+  permission java.io.FilePermission "${derbyTesting.codedir}${/}*", "read";
+  permission java.util.PropertyPermission "java.class.path", "read";
+};

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties.policy
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties.policy?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties.policy (original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo_withproperties.policy Fri Sep 15 12:27:15 2006
@@ -26,3 +26,9 @@
   //client side: test execs another jvm with relative path
   permission java.io.FilePermission "<<ALL FILES>>", "execute";
 };
+
+// See DERBY-1832
+grant codeBase "${derbyTesting.codejar}/derbyclient.jar" {
+  permission java.io.FilePermission "${derbyTesting.codedir}${/}*", "read";
+  permission java.util.PropertyPermission "java.class.path", "read";
+};

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java (original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java Fri Sep 15 12:27:15 2006
@@ -77,6 +77,18 @@
         conn.close();
     }
     
+    /** Create a test suite with all tests in this class. */
+    public static Test suite() {
+        TestSuite ts = new TestSuite();
+
+        // Test will fail with JCC.
+        if (usingDerbyNet()) {
+            return ts;
+        }
+
+        ts.addTestSuite(UpdatableResultSetTest.class);
+        return ts;
+    }
     
     /**
      * Tests insertRow with table name containing quotes

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java (original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java Fri Sep 15 12:27:15 2006
@@ -52,6 +52,7 @@
 		suite.addTest(ProcedureTest.suite());
 		suite.addTest(SURQueryMixTest.suite());
 		suite.addTest(SURTest.suite());
+		suite.addTest(UpdatableResultSetTest.suite());
 		suite.addTest(UpdateXXXTest.suite());
 		suite.addTestSuite(URCoveringIndexTest.class);
         suite.addTest(ResultSetCloseTest.suite());

Modified: db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java?view=diff&rev=446700&r1=446699&r2=446700
==============================================================================
--- db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java (original)
+++ db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java Fri Sep 15 12:27:15 2006
@@ -255,13 +255,13 @@
         catch (SQLException e)
         {
 			TestUtil.dumpSQLExceptions(e);
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
         catch (Throwable e)
         {
 			System.out.println("xFAIL -- unexpected exception:" + e.toString());
 //            e.fillInStackTrace();
-            if (debug) e.printStackTrace();
+            if (debug) e.printStackTrace(System.out);
 		}
 		System.out.println("Test blobclob finished\n");
     }
@@ -369,11 +369,11 @@
         }
 		catch (SQLException e) {
 			TestUtil.dumpSQLExceptions(e);
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
         //System.out.println("prepareCLOBMAIN finished");
     }
@@ -442,11 +442,11 @@
         }
 		catch (SQLException e) {
 			TestUtil.dumpSQLExceptions(e);
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
         System.out.println("prepareSearchClobTable finished");
     }
@@ -509,7 +509,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
 
     }
@@ -588,7 +588,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -636,7 +636,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -694,7 +694,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -750,7 +750,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-            if (debug) e.printStackTrace();
+            if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -819,7 +819,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-            if (debug) e.printStackTrace();
+            if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -885,7 +885,7 @@
         }
         catch (Throwable e) {
             System.out.println("FAIL -- unexpected exception:" + e.toString());
-            if (debug) e.printStackTrace();
+            if (debug) e.printStackTrace(System.out);
         }
         
     }
@@ -954,7 +954,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1004,7 +1004,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1055,7 +1055,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1110,7 +1110,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1174,11 +1174,11 @@
         }
 		catch (SQLException e) {
 			TestUtil.dumpSQLExceptions(e);
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1222,7 +1222,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1327,7 +1327,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1374,7 +1374,7 @@
 		catch (Throwable e) {
 			System.out.println("52: Throwable");
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1398,7 +1398,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1444,7 +1444,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
 		System.out.println("end clobTest54");
     }
@@ -1567,7 +1567,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1627,11 +1627,11 @@
         }
 		catch (SQLException e) {
 			TestUtil.dumpSQLExceptions(e);
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -1789,7 +1789,7 @@
 
 		} catch (SQLException e) {
 			TestUtil.dumpSQLExceptions(e);
-			e.printStackTrace();
+			e.printStackTrace(System.out);
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
@@ -1972,7 +1972,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2027,7 +2027,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2089,7 +2089,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2174,7 +2174,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2284,7 +2284,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2335,7 +2335,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2402,7 +2402,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2436,7 +2436,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2518,7 +2518,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2574,7 +2574,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2821,7 +2821,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2882,7 +2882,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2919,7 +2919,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -2968,7 +2968,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-            if (debug) e.printStackTrace();
+            if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3049,7 +3049,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3091,7 +3091,7 @@
 		catch (Throwable e)
         {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3156,7 +3156,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3185,7 +3185,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3309,7 +3309,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3361,7 +3361,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3430,7 +3430,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
     
@@ -3492,7 +3492,7 @@
         }
         catch (Throwable e) {
             System.out.println("FAIL -- unexpected exception:" + e.toString());
-            if (debug) e.printStackTrace();
+            if (debug) e.printStackTrace(System.out);
         }
         
     }
@@ -3592,7 +3592,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3632,7 +3632,7 @@
  		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
         System.out.println("blobTest52 finished");
     }
@@ -3657,7 +3657,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3708,7 +3708,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
         System.out.println("blobTest54 finished");
     }
@@ -3833,7 +3833,7 @@
 			else 
 			{
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 			}
 		}
     }
@@ -3898,7 +3898,7 @@
 		catch (Throwable e) {
 			System.out.println("blobTest7 FAIL -- unexpected exception:" + e.toString());
             e.fillInStackTrace();
-            if (debug) e.printStackTrace();
+            if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -3957,7 +3957,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -4027,7 +4027,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -4091,7 +4091,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -4176,7 +4176,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
 
     }
@@ -4271,7 +4271,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -4326,7 +4326,7 @@
 		}
 		catch (Throwable e) {
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-			if (debug) e.printStackTrace();
+			if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -4695,13 +4695,13 @@
 			else
 			{
 				System.out.println("FAIL -- unexpected exception:" + obe.toString());
-				if (debug) obe.printStackTrace();
+				if (debug) obe.printStackTrace(System.out);
 			}
 		}
 		catch (Exception e)
 		{
 			System.out.println("FAIL -- unexpected exception:" + e.toString());
-	        if (debug) e.printStackTrace();
+	        if (debug) e.printStackTrace(System.out);
 		}
     }
 
@@ -4782,7 +4782,7 @@
 	
 				
 			TestUtil.dumpSQLExceptions(e, expected);
-			e.printStackTrace();
+			e.printStackTrace(System.out);
 		}
     }
 



Mime
View raw message