]
Gail Badner closed HHH-2357.
----------------------------
Assignee: Gail Badner
Resolution: Rejected
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
Issue Type: Patch
Components: core
Affects Versions: 3.2.1
Environment: Hibernate 3.2.1, Oracle 9i, Oracle 10g, JDK 1.5+
Reporter: Benoit Goudreault-Emond
Assignee: Gail Badner
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: