[
https://issues.apache.org/jira/browse/DERBY-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
A B updated DERBY-2488:
-----------------------
Attachment: d2488_notTested_v1.patch
I read Dan's comments on this issue and I (perhaps incorrectly) interpret them
to mean that the fix for this problem is to simply ensure that
EmbeddedConnectionPoolDataSource returns JDBC 4 objects when the app is running
with JDK 6. That said, it looks like there is only one JDBC 4 object that can
be returned from EmbeddedConnectionPoolDataSource, and that object is a
PooledConnection. So I made the attached change (d2488_notTested_v1.patch),
which is pretty much just a one-liner to return a JDBC 4 PooledConnection when
running with JDK 6.
The patch does a similar thing in EmbeddedXADataSource just because that
*seems* like a similar situation. I don't know for sure if that's necessary,
but it looks like it could be.
As the name implies I have not fully tested this patch. All I've done is run
the repro attached to this issue and verified that the _v1 patch causes the
repro to run successfully, even with an input argument that is not "6.0":
> java showJDBCdsMetaDataLis dbdb 2.4
. . JDBC 3 or less: Using jdbc.EmbeddedConnectionPoolDataSource
Database product: Apache Derby
Database version: 10.3.0.0 alpha - (1)
Driver name: Apache Derby Embedded JDBC Driver
Driver version: 10.3.0.0 alpha - (1)
JDBC driver major version: 4
JDBC driver minor version: 0
JDBC 4.0 metaData - SFusingCall: true
Event: statementClosed a816c00e-0111-b830-0576-0000003d4c38
Please note, though, that I am not at all familiar with this area of code, so
it's possible I'm being far too naive here. If that's the case then I'm hoping
someone can elaborate a bit more on what the correct approach might be...
> When loaded by jvm1.6 - Derby JDBC 3.0 driver returns 4 for JDBC driver major
> ------------------------------------------------------------------------------
>
> Key: DERBY-2488
> URL: https://issues.apache.org/jira/browse/DERBY-2488
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.2.2.0
> Environment: Run test using JVM 1.6
> Reporter: Stan Bradbury
> Attachments: d2488_notTested_v1.patch, showJDBCdsMetaDataLis.class,
> showJDBCdsMetaDataLis.class, showJDBCdsMetaDataLis.java,
> showJDBCdsMetaDataLis.java
>
>
> When loaded using JVM 1.6 the JDBC 3.0 data source
> (org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource) is reporting a JDBC
> spec compliance level of 4. The DatabaseMetaData.getJDBCMajorVersion method
> should return the
> correct spec compliance level (3) for the JDBC 3.0 data source. The
> application server that relies on the reported spec compliance level to
> determine if a statement event listener should be registered will encounter a
> failure when attemptting to register an event listener with the JDBC 3.0
> driver.
> Note that the JDBC 4.0 metadata call
> ..getMetaData().supportsStoredFunctionsUsingCallSyntax() is executed by the
> JDBC 3.0 driver. This doesn't bother me but seems curious that this is
> supported by a JDBC 3.0 driver.
> Attached is a test case based on the test code from DERBY-8862 (JDBC 4 driver
> reports incorrect spec complieance level).
> Running the test:
> set JAVA_HOME to a 1.6 JVM
> Compile program
> run command: ${JAVA_HOME}/java showJDBCdsMetaDataLis <path-to-database> 3.0
> Using JAVA 6.0
> > "%JAVA_HOME%\bin\java" showJDBCdsMetaDataLis "c:\tstdb102" 3.0
> . . JDBC 3 or less: Using jdbc.EmbeddedConnectionPoolDataSource
> Database product: Apache Derby
> Database version: 10.2.2.0 - (485682)
> Driver name: Apache Derby Embedded JDBC Driver
> Driver version: 10.2.2.0 - (485682)
> JDBC driver major version: 4
> JDBC driver minor version: 0
> JDBC 4.0 metaData - SFusingCall: true
> >> exception thrown:
> A non SQL error occured.
> java.lang.AbstractMethodError:
> org.apache.derby.jdbc.EmbedPooledConnection.addStatementEventListener(Ljavax/sql/Statemen
> tEventListener;)V
> at showJDBCdsMetaDataLis.main(showJDBCdsMetaDataLis.java:103)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.