openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Holloway (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-638) Timestamp unsuitable for versioning on PostgreSQL databases
Date Sat, 28 Jun 2008 12:53:44 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609008#action_12609008
] 

Tim Holloway commented on OPENJPA-638:
--------------------------------------

This problem can be mitigated by defining the database field as being of type timestamp(0),
which limits the timestamp's precision to an integral number of seconds.

> Timestamp unsuitable for versioning on PostgreSQL databases
> -----------------------------------------------------------
>
>                 Key: OPENJPA-638
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-638
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: docs
>         Environment: PostgreSQL ca Version 8, Section 2.17 of the Apache OpenJPA User's
Guide.
>            Reporter: Tim Holloway
>
> PostgreSQL can store objects in its native timestamp in a format determined by PostgreSQL
build options. By default, the postgresql timestamp is a double-precision floating-point number
with maximum precision of 6 digits (see section 8.4 of the PostgreSQL 8.2.7 documentation).
java.sql.Timestamp extends java.util.Date, and thus stores data in long integer milliseconds.
The resulting value mismatch can cause optimistic updates to fail.
> See also Jira issue OpenJPA-636.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message