db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r110114 - in incubator/derby/code/trunk/java: engine/org/apache/derby/iapi/error engine/org/apache/derby/impl/jdbc testing/org/apache/derbyTesting/functionTests/master testing/org/apache/derbyTesting/functionTests/tests/lang
Date Tue, 07 Dec 2004 17:27:37 GMT
Author: djd
Date: Tue Dec  7 09:27:35 2004
New Revision: 110114

URL: http://svn.apache.org/viewcvs?view=rev&rev=110114
Log:
Fix Derby-62, serialization of SQLExcepton thrown by Derby throws error due to
references to non-serializable objects.

Modified:
   incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedSQLException.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java?view=diff&rev=110114&p1=incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java&r1=110113&p2=incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java&r2=110114
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java
Tue Dec  7 09:27:35 2004
@@ -57,11 +57,11 @@
 	 * Exception State
 	 */
 	private Throwable nestedException;
-	private Object[] arguments;
+	private transient Object[] arguments;
 	private int severity;
 	private String textMessage;
 	private String sqlState;
-	private int report;
+	private transient int report;
 
 	/*
 	** End of constructors

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedSQLException.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedSQLException.java?view=diff&rev=110114&p1=incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedSQLException.java&r1=110113&p2=incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedSQLException.java&r2=110114
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedSQLException.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedSQLException.java
Tue Dec  7 09:27:35 2004
@@ -38,7 +38,7 @@
 */
 public class EmbedSQLException extends SQLException {
 
-	private Object[] arguments;
+	private transient Object[] arguments;
 	private String messageId;
 
 	/**
@@ -47,7 +47,7 @@
     //Because it's transient, it doesn't get sent over to the client
     //side and hence the classes which needs to be included in the
     //client.jar file decreases 5 folds.
-	transient protected Throwable javaException;
+	private transient Throwable javaException;
 
 	/**
 	 * Because SQLException does not have settable fields,

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out?view=diff&rev=110114&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out&r1=110113&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out&r2=110114
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out
(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/closed.out
Tue Dec  7 09:27:35 2004
@@ -1,4 +1,6 @@
 Test closed starting
+Test case for Derby-62 - serialization error with SQLException
+'DROP TABLE' cannot be performed on 'APP.DERBY62_DAIN_SUNDSTROM' because it does not exist.
 ERROR XJ012: 'Statement' already closed.
 ERROR XCL16: ResultSet not open, operation 'next' not permitted. Verify that autocommit is
OFF.
 ERROR XCL16: ResultSet not open, operation 'next' not permitted. Verify that autocommit is
OFF.

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java?view=diff&rev=110114&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java&r1=110113&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java&r2=110114
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java
(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/closed.java
Tue Dec  7 09:27:35 2004
@@ -61,6 +61,8 @@
 
 			String url = conn.getMetaData().getURL();
 
+			passed = testDerby62(conn) && passed;
+
 			// want all tests to run regardless of intermediate errors
 			passed = testStatement(conn) && passed;
 
@@ -417,6 +419,30 @@
 			System.out.println("FAIL -- no error on getting metadata after connection close");
 
 		return passed;
+	}
+
+	static boolean testDerby62(Connection conn) throws SQLException {
+
+		System.out.println("Test case for Derby-62 - serialization error with SQLException");
+		try {
+			conn.createStatement().execute("DROP TABLE APP.DERBY62_DAIN_SUNDSTROM");
+			return false;
+		} catch (SQLException sqle) {
+			boolean passed = true;
+			try {
+				// ensure we can serialize this exception.
+				java.io.ObjectOutputStream oos = new java.io.ObjectOutputStream(new java.io.ByteArrayOutputStream(1024));
+				oos.writeObject(sqle);
+				oos.close();
+			} catch (java.io.IOException ioe)
+			{
+				System.out.println("IOException " + ioe.getMessage());
+				passed = false;
+
+			}
+			System.out.println(sqle.getMessage());
+			return passed;
+		}
 	}
 
 }

Mime
View raw message