You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Tim Holloway (JIRA)" <ji...@apache.org> on 2008/06/19 19:53:45 UTC
[jira] Created: (OPENJPA-638) Timestamp unsuitable for versioning
on PostgreSQL databases
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.
[jira] Commented: (OPENJPA-638) Timestamp unsuitable for versioning
on PostgreSQL databases
Posted by "Tim Holloway (JIRA)" <ji...@apache.org>.
[ 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.