db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Matz <oliver.m...@ppi.de>
Subject [OJB] Issue #OJB166 - rounding error long-BigDecimal in AbstractSequenceManager
Date Wed, 07 May 2003 14:37:35 GMT
You can view the issue detail at the following URL:
<http://scarab.werken.com/scarab/issues/id/OJB166>

Type :        Defect
Issue Id :    OJB166
Reported by: Oliver Matz
             oliverm - (oliver.matz@ppi.de)

Details:

Platform: All
Operating system: windows 2000
Summary: rounding error long-BigDecimal in AbstractSequenceManager
Description: The problem occurs when you use primary keys fields 
of type long mapped to NUMERIC table column
and there are more than 52 significant bits.

Then the method AbstractSequenceManager.getUniqueValue converts a long to a BigDecimal via
an implicit conversion to double.
In this implicit conversion, a rounding error may occur if the long is larger than 2^52. 
This may lead to non-unique
ids, which can cause a variety of other problems.

The problem cannot be reproduced with the current 
test suite because there are only int primary fields.

A fix is appended.

Status: Unconfirmed
Severity: Normal


Mime
View raw message