db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r587040 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/jdbc/EmbedConnection.java testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
Date Mon, 22 Oct 2007 08:53:22 GMT
Author: dag
Date: Mon Oct 22 01:53:21 2007
New Revision: 587040

URL: http://svn.apache.org/viewvc?rev=587040&view=rev
Log:
DERBY-2065 Network and embedded difference in SQLSTATE and message when Connection.close()
with open transaction

Patch derby-2065_1. As a result of this patch
SQLState.LANG_INVALID_TRANSACTION_STATE and the testsing framework's
equivalent SQLStateConstants.INVALID_TRANSACTION_STATE_NO_SUBCLASS are
now unused, but I leave them declared since the constant 25000 is defined
in the standard and may find some future use.

Patch committed by Jorgen Loland.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java?rev=587040&r1=587039&r2=587040&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java Mon Oct
22 01:53:21 2007
@@ -1174,7 +1174,7 @@
 				(rootConnection == this) && 
 				(!autoCommit && !transactionIsIdle())) {
 			throw newSQLException(
-				SQLState.LANG_INVALID_TRANSACTION_STATE);
+				SQLState.CANNOT_CLOSE_ACTIVE_CONNECTION);
 		}
 		
 		close(exceptionClose);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java?rev=587040&r1=587039&r2=587040&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
Mon Oct 22 01:53:21 2007
@@ -165,11 +165,8 @@
         } catch (SQLException sqle) {
             // The SQL State is incorrect in the embedded client, see
             // JIRA id DERBY-1168
-            String expectedState;
-            if ( this.usingDerbyNetClient() )
-                expectedState = SQLStateConstants.INVALID_TRANSACTION_STATE_ACTIVE_SQL_TRANSACTION;
-            else
-                expectedState = SQLStateConstants.INVALID_TRANSACTION_STATE_NO_SUBCLASS;
+            String expectedState =
+                SQLStateConstants.INVALID_TRANSACTION_STATE_ACTIVE_SQL_TRANSACTION;
             
             if ( ! expectedState.equals(sqle.getSQLState()) )
             {



Mime
View raw message