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: 6458333
Votes 0
Synopsis DataSet.insert() may fail when multiple threads attempt to insert. No exception is thrown.
Category jdbc:eod
Reported Against b91
Release Fixed mustang(b98)
State 10-Fix Delivered, Verified, bug
Priority: 2-High
Related Bugs 6460067
Submit Date 09-AUG-2006
Description
Zero or more threads in the attached test case may fail to insert with the message:

java.sql.SQLException: Exception encountered: java.sql.SQLException: The last argument must be either a Connection or a DataSource
        at com.sun.sql.QueryObjectGeneratorImpl.getQueryImpl(QueryObjectGeneratorImpl.java:769)
        at com.sun.sql.QueryObjectGeneratorImpl.access$100(QueryObjectGeneratorImpl.java:24)
        at com.sun.sql.QueryObjectGeneratorImpl$2.run(QueryObjectGeneratorImpl.java:221)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.sql.QueryObjectGeneratorImpl.invoke(QueryObjectGeneratorImpl.java:216)
        at $Proxy0.getAddresses(Unknown Source)
        at ConcurrentQueryObjectTest.insertAddress(ConcurrentQueryObjectTest.java:126)
        at ConcurrentQueryObjectTest$ClientThread.run(ConcurrentQueryObjectTest.java:164)
        at java.lang.Thread.run(Thread.java:619)
Inserting address in thread ThreadSafeID-9
Failed to insert address in thread ThreadSafeID-9
java.lang.NullPointerException
        at ConcurrentQueryObjectTest.insertAddress(ConcurrentQueryObjectTest.java:129)
        at ConcurrentQueryObjectTest$ClientThread.run(ConcurrentQueryObjectTest.java:164)
        at java.lang.Thread.run(Thread.java:619)import java.sql.BaseQuery;

The stack trace is displayed but no exception is thrown.  (The NPE occurs after the initial problem.)  The error message displayed is not informative for the user.
Posted Date : 2006-08-09 03:37:07.0
Work Around
N/A
Evaluation
Being worked on
Posted Date : 2006-08-11 06:59:31.0

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.
Posted Date : 2006-08-11 10:34:02.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang