You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Oliver Matz <ol...@ppi.de> on 2003/05/07 16:37:35 UTC

[OJB] Issue #OJB166 - rounding error long-BigDecimal in AbstractSequenceManager

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