SUGGESTED FIX
Fix for bug 6458333/6460067. Incoporated Craig and Binod suggestions.
Made connection and datasource non-static. Also created a new class
QueryObject and moved all query related invocations to QueryObject.
QueryObjectGeneratorImpl in now a simple implementation of
QueryObjectGenerator interface. It now creates instance of QueryObject
and passes it to application which calls createQueryObject().
checkin logs :
RCS file: /m/jws/jdbc4.0/src/com/sun/sql/QueryObject.java,v
done
Checking in QueryObject.java;
/m/jws/jdbc4.0/src/com/sun/sql/QueryObject.java,v <-- QueryObject.java
initial revision: 1.1
done
Checking in QueryObjectGeneratorImpl.java;
/m/jws/jdbc4.0/src/com/sun/sql/QueryObjectGeneratorImpl.java,v <-- QueryObjectGeneratorImpl.java
new revision: 1.61; previous revision: 1.60
done
|
|
|
SUGGESTED FIX
I looked at the code as well.
Besides all that Craig wrote, it will be good, if we can split QueryObjectGeneratorImpl into a better design, at a minimum encapsulating the proxy query object to another class.
|
|
|
SUGGESTED FIX
1. Remove the ThreadLocal code from the QueryObjectGeneratorImpl class. There are no thread-local requirements for the class.
2. Remove the "static" declaration from DataSource dSource and Connection conn. These should be fields of the instance used to create and manage a QueryObject instance.
3. Create constructors for QueryObjectGeneratorImpl that take a DataSource and a Connection, respectively.
4. Call these constructors from the factory methods createQueryObject(ifc, DataSource) and createQueryObject(ifc, Connection).
|
|
|
EVALUATION
Being worked on
|
|
|
EVALUATION
This is not a JDBC EOD bug. The eod code is thread safe.
There are test case and derby issues with this.
A) Test Case :
1. The createQueryObject() of Connection is being used in the test case. This will be driver specific. Please use QueryObjectFactory.createQueryObject() instead to test EDOD code.
B) Derby issues :
1. Before runThreads() there is an open connection. In insertAddress() another
connection is being created that will cause exceptions. This is a derby problem.
2. Updatable ResultSet has been implemented in derby after 10.2 version. Hence,
after the other corrections, tests will fail because ResultSet is CONCUR_READ_ONLY.
Please test the test case after resolving test case and derby issues. I will then close this as not a bug.
I tested the test case without any changes, with Oracle DB. It is passing.
|
|
|
|