DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ludovic Galibert
Votes: 0
Watchers: 0

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 (2 kB)

Environment: Oracle 11g ( 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 ( cannot be cast to oracle.sql.CLOB) when writing CLOBs and an IllegalAccessError (tried to access class oracle.jdbc.driver.OracleResultSet from class 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.


Sort Order: Ascending order - Click to sort in descending order
Ludovic Galibert added a comment - 22/Feb/12 12:33 PM
Testcase and patches

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.

Andy Jefferson added a comment - 22/Feb/12 03:31 PM
What does your non-standard JDBC driver return for
DatabaseMetaData.getDriverName() ?

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