Hi Olav,

Thanks for digging into this. The differences in the embedded output are caused by JDBC4's introduction of SQLException subclasses. These now replace Derby's hand-rolled subclass of SQLException. The old Derby subclass overrode the getMessage() method. That's why you used to see "SQL Exception:..." and now you see "java.sql.SQLSyntaxErrorException:..." I suppose that we could get close to the old message text if we introduced a Derby subclass for each of the JDBC4 exception subclasses and then override the getMessage() in each of these. This seems like a lot of code bloat without much payback. I think that handling these discrepancies with a sed script is fine.

I don't understand why the trailing SQLSTATE info has been stripped off the network messages. Perhaps network serialization of chained exceptions needs a closer look.

Regards,
-Rick



Olav Sandstaa wrote:

I am working on reducing the number of tests failing when running with
JDK 1.6. Some of the tests are now failing due to jdk16 specific
master files that have not been updated after introduction of textual
changes. To solve some of these failing tests I try eliminate the need
for jdk16 specific master files.

To avoid creating to more sed rules for filtering some of the
differences I wonder if some of the changes better had been fixed by
making sure that the output is more consistent between client and
embedded driver and between JDK 1.5 and JDK 1.6.

I would like to get feedback on whether the following example should
best be solved by fixing the difference between the output from ij or
by continue to have multiple master files. This example is from the
ieptests.sql which now fails with JDK 1.6 with the client driver:


SQL that makes the test fail:
=============================

ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('inventory', 'ORDERTABLE' , 'extinout/order.dat', null, null, null) ;


Java 1.5 Embedded output:
=========================

ERROR 38000: The exception 'SQL Exception: Schema 'inventory' does not exist' was thrown while evaluating an expression.
ERROR 42Y07: Schema 'inventory' does not exist


Java 1.6 Embedded output:
=========================

ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Schema 'inventory' does not exist' was thrown while evaluating an expression.
ERROR 42Y07: Schema 'inventory' does not exist


Java 1.5 Client output:
=======================

ERROR 38000: The exception 'SQL Exception: Schema 'inventory' does not exist' was thrown while evaluating an expression. SQLSTATE: 42Y07: Schema 'inventory' does not exist


Java 1.6 Client output:
=======================

ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Schema 'inventory' does not exist' was thrown while evaluating an expression.


The main difference is:

-embedded: with JDK 1.5 the output writes "SQL Exception" while on
 JDK 1.6 it is "java.sql.SQLSyntaxErrorException" (more exact, but
 less read-friendly?). This difference is handled by seding the
 output.

-client: with JDK 1.5 the SQL state is included in the output, while
 with JDK 1.6 the SQL state is not included. Is this a bug?

-embedded vs server: embedded writes the output split over two lines,
 while the client has everything on one line. Could this be changed?

In addition to the detailed question about the specific output making
this test fail, I wonder if we should have some general rules that we
should attempt the output (error/warnings/responses) from ij be as
similar as possible for (a) between client and server and (b) between
different versions of the JVM?

Any feedback is appreciated!

Thanks,
Olav


Reply via email to