Issue Details (XML | Word | Printable)

Key: NUCRDBMS-582
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ludovic Galibert
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Oracle: cannot write BLOB and CLOB using a non-standard driver

Created: 22/Feb/12 12:32 PM   Updated: 21/Mar/12 10:19 AM   Resolved: 22/Feb/12 04:14 PM
Component/s: Value Generation
Affects Version/s: None
Fix Version/s: 3.0.8, 3.1.0.m1

File Attachments: 1. Text File OracleBlobRDBMSMapping.patch (2 kB)
2. Text File OracleClobRDBMSMapping.patch (2 kB)
3. Zip Archive testcase-inet-driver.zip (2 kB)

Environment: Oracle 11g (11.2.0.1.0) on Windows Server 2008 R2, i-net Oranxo driver 3.09

Datastore: Oracle
Severity: Development


 Description  « Hide
There is an issue in OracleBlobRDBMSMapping and OracleClobRDBMSMapping in the workaround implementation for OJDBC drivers < 10. If the jdbcMajorVersion is < 10, the code relies on some old implementation of the JDBC driver is called.

The i-net Oranxo driver uses a different JDBC major version being currently 3. This leads to a ClassCastException (com.inet.ora.ag cannot be cast to oracle.sql.CLOB) when writing CLOBs and an IllegalAccessError (tried to access class oracle.jdbc.driver.OracleResultSet from class org.datanucleus.store.rdbms.mapping.oracle.OracleBlobRDBMSMapping) when writing BLOBs.

The DatabaseMetaData:getJDBCMajorVersion() javadoc states "Retrieves the major JDBC version number for this driver" which in my opinion does not need to match the DB version.

I will add the patches I wrote that allow writing BLOBs and CLOBs using the i-net driver, I hope you can add these in the next release, that would be greatly appreciated.
Unfortunately I cannot provide access to the i-net driver, I hope you can somehow get access to it so you can run my test case.

Thanks

Ludovic Galibert added a comment - 22/Feb/12 12:33 PM
Testcase and patches

Ludovic Galibert made changes - 22/Feb/12 12:33 PM
Field Original Value New Value
Attachment testcase-inet-driver.zip [ 11600 ]
Attachment OracleBlobRDBMSMapping.patch [ 11601 ]
Attachment OracleClobRDBMSMapping.patch [ 11602 ]
Ludovic Galibert added a comment - 22/Feb/12 12:36 PM - edited
Sorry, my session was no longer valid as I submitted the issue, so I had to recreate it but forgot to set the version affected. Since I can't edit, can someone please tag for 3.0.6? Actually it's still not working with 3.0.7, but my patches were made against 3.0.6.

Thanks in advance.

Ludovic Galibert made changes - 22/Feb/12 12:54 PM
Attachment testcase-inet-driver.zip [ 11600 ]
Ludovic Galibert made changes - 22/Feb/12 12:54 PM
Attachment testcase-inet-driver.zip [ 11603 ]
Andy Jefferson added a comment - 22/Feb/12 03:31 PM
What does your non-standard JDBC driver return for
DatabaseMetaData.getDriverName() ?

Andy Jefferson made changes - 22/Feb/12 03:31 PM
Priority Critical [ 2 ] Major [ 3 ]
Ludovic Galibert added a comment - 22/Feb/12 03:43 PM
It returns "i-net Oranxo(tm)".
In my patch I'm using the driver name from OracleDatabaseMetaData (if in the classpath) to check if the standard driver is being used because I think this provides a generic solution for non-standard drivers, which will most likely not return "Oracle JDBC driver".

Andy Jefferson added a comment - 22/Feb/12 04:14 PM
SVN trunk (and branches/3.0) have a check against the datastoreDriverName comparing to "Oracle JDBC driver" (rather than the patch which used reflection and only used the default class loader). It's only to cater for old versions of OJDBC anyway so that string can't change, and if any non-standard drivers use that string then its their fault for claiming to be Oracle

Andy Jefferson made changes - 22/Feb/12 04:14 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0.8 [ 11485 ]
Fix Version/s 3.1.0.m1 [ 11451 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 21/Mar/12 10:19 AM
Status Resolved [ 5 ] Closed [ 6 ]