Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6460067
Votes 0
Synopsis A call to QueryObjectFactory.createDefaultQueryObject() loses the con object of a preceding call
Category jdbc:eod
Reported Against
Release Fixed mustang(b98)
State 10-Fix Delivered, Verified, bug
Priority: 2-High
Related Bugs 6458333
Submit Date 14-AUG-2006
Description
The attached test case creates two Connection objects, uses each to get its own Query  customer  by invoking QueryObjectFactory.createDefaultQueryObject(), then closes the second connection. The application uses the first connection to create a table, but when it attempts to get a DataSet with this connection, a runtime exception ("No current connection") is thrown.  So, although the Connection is open and can be used by the application, it is no longer available to the JDBC implementation.

If the second call (using the second connection) to QueryObjectFactory.createDefaultQueryObject is not made, no runtime exception is thrown.

The complete output is:

Creating con1
Creating con2
Creating addressQuery1 with con1.
Creating addressQuery2 with con2. If this step is omitted, getting addressesDataSet1 with con1 succeeds.
Closing con2
Is con1 closed? false
Is con2 closed? true
Creating table with con1
Successfully created table with con1
Getting addressesDataSet1 with con1
Failed to get addressesDataSet1. con1 is no longer available to EoD. Stack trace follows
java.sql.SQLRuntimeException: java.sql.SQLTransientConnectionException: No current connection.
        at com.sun.sql.QueryObjectGeneratorImpl$2.run(QueryObjectGeneratorImpl.java:225)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.sql.QueryObjectGeneratorImpl.invoke(QueryObjectGeneratorImpl.java:217)
        at $Proxy0.getAddresses(Unknown Source)
        at TwoConTest.main(TwoConTest.java:84)
Caused by: java.sql.SQLTransientConnectionException: No current connection.
        at org. customer .derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org. customer .derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        at org. customer .derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org. customer .derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org. customer .derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org. customer .derby.impl.jdbc.Util.noCurrentConnection(Unknown Source)
        at org. customer .derby.impl.jdbc.EmbedConnection.checkIfClosed(Unknown Source)
        at org. customer .derby.impl.jdbc.EmbedConnection.setupContextStack(Unknown Source)
        at org. customer .derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
        at org. customer .derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
        at com.sun.sql.QueryObjectGeneratorImpl.getQueryImpl(QueryObjectGeneratorImpl.java:762)
        at com.sun.sql.QueryObjectGeneratorImpl.access$100(QueryObjectGeneratorImpl.java:24)
        at com.sun.sql.QueryObjectGeneratorImpl$2.run(QueryObjectGeneratorImpl.java:222)
        ... 4 more
Caused by: SQL Exception: No current connection.
        ... 17 more
Dropping table with con1
Successfully dropped table with con1
Closing con1
Posted Date : 2006-08-14 21:04:43.0
Work Around
N/A
Evaluation
This issue is similar to 6458333. Will be fixed as part of its bug fix.
Posted Date : 2006-08-22 11:26:06.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang