Issue Details (XML | Word | Printable)

Key: DERBY-2084
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Bernt M. Johnsen
Reporter: Bernt M. Johnsen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

getTransactionIsolation() in network client should not activate a transaction

Created: 14/Nov/06 12:30 PM   Updated: 30/Jun/09 03:55 PM
Return to search
Component/s: Network Client
Affects Version/s: 10.1.3.1, 10.2.1.6, 10.3.1.4
Fix Version/s: 10.1.3.2, 10.2.2.0, 10.3.1.4

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works DERBY-2084.diff 2006-11-14 01:25 PM Bernt M. Johnsen 1 kB
Issue Links:
Incorporates
 
Reference
 

Bug behavior facts: Regression
Resolution Date: 17/Nov/06 12:29 PM


 Description  « Hide
getTransactionIsolation() is implemented by means of
     rs = getTransactionIsolationStmt.executeQuery("values current isolation");

This will activate a transaction. Thus the code snippet

        Connection conn =
            DriverManager.getConnection(url);
        conn.setAutoCommit(false);
        int tx = conn.getTransactionIsolation();
        conn.close();

will fail with

java.sql.SQLException: Cannot close a connection while a transaction is still active.
        at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
        at org.apache.derby.client.am.Connection.closeResourcesX(Unknown Source)
        at org.apache.derby.client.am.Connection.closeX(Unknown Source)
        at org.apache.derby.client.net.NetConnection.closeX(Unknown Source)
        at org.apache.derby.client.am.Connection.close(Unknown Source)
        at org.apache.derby.client.net.NetConnection.close(Unknown Source)
        at GetTransactionIsolation.test(GetTransactionIsolation.java:12)
        at GetTransactionIsolation.main(GetTransactionIsolation.java:22)
Caused by: org.apache.derby.client.am.SqlException: Cannot close a connection while a transaction is still active.
        at org.apache.derby.client.am.Connection.checkForTransactionInProgress(Unknown Source)
        ... 7 more



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #476087 Fri Nov 17 09:17:55 UTC 2006 bernt DERBY-2084 getTransactionIsolation() in network client should not activate a transaction
Files Changed
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java

Repository Revision Date User Message
ASF #476088 Fri Nov 17 09:21:18 UTC 2006 bernt DERBY-2084 merged from trunk
Files Changed
MODIFY /db/derby/code/branches/10.2/java/client/org/apache/derby/client/am/Connection.java

Repository Revision Date User Message
ASF #476119 Fri Nov 17 12:28:12 UTC 2006 bernt DERBY-2084 merged from trunk to 10.1
Files Changed
MODIFY /db/derby/code/branches/10.1/java/client/org/apache/derby/client/am/Connection.java