[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2357) Patch to work around setDecimal() bug with Oracle JDBC driver < 10.2.0.4 and JDK >= 1.5 (bug 5527479

Henri Yandell (JIRA) noreply at atlassian.com
Fri Jan 12 11:22:44 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2357?page=comments#action_25789 ] 

Henri Yandell commented on HHH-2357:
------------------------------------


Just as another option - you could implement a wrapper driver that fixes the bug and delegates all other calls down to the Oracle JDBC driver.

> Patch to work around setDecimal() bug with Oracle JDBC driver < 10.2.0.4 and JDK >= 1.5 (bug 5527479
> ----------------------------------------------------------------------------------------------------
>
>          Key: HHH-2357
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2357
>      Project: Hibernate3
>         Type: Patch

>   Components: core
>     Versions: 3.2.1
>  Environment: Hibernate 3.2.1, Oracle 9i, Oracle 10g, JDK 1.5+
>     Reporter: Benoit Goudreault-Emond
>  Attachments: WorkaroundForOracleBrokenSetDecimal.patch
>
>
> First, see http://www.javalobby.org/java/forums/t88158.html
> In a nutshell, JDK 1.5 changed the representation of BigDecimal; namely, they changed totally the way toString() works. Nobody is sure how Oracle parses out the BigDecimal for storage inside the database, but it seems BigDecimals with negative scales don't work well. It's not really this surprising, given that Sun did something a bit evil here (changing the contract of the scale property, for one).
> The proposed workarounds from Oracle: 1) stay with JDK 1.4 (not an option when you've written several thousand lines of generic-aware code, retroweaver nonwithstanding) 2) wait for their patched JDBC driver.
> However, they won't issue a patch for Oracle 9i, and those using the OCI driver are kinda stuck.  Plus, Oracle's patch isn't there yet.
> This patch is not necessarily meant to go in the main Hibernate code; it is, after all, Oracle's bug.  Still, the patch itself is harmless even for other databases (it simply rescales the BigDecimal), and if it's useful to someone, great.  It seems to
> be a good solution in the meantime.
> I've marked this bug as MAJOR because it can lead to data corruption--the BigDecimal put in is not the one you get back.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list