empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele (JIRA) <empire-db-...@incubator.apache.org>
Subject [jira] Resolved: (EMPIREDB-81) endless loop in DBSeqTable#getNextValue()
Date Sun, 20 Feb 2011 22:18:38 GMT

     [ https://issues.apache.org/jira/browse/EMPIREDB-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rainer Döbele resolved EMPIREDB-81.
-----------------------------------

    Resolution: Fixed
      Assignee: Rainer Döbele

fixed using prepared statement params instead of a string reprentation of the current value.
Must be verified using a postgre database.

> endless loop in DBSeqTable#getNextValue()
> -----------------------------------------
>
>                 Key: EMPIREDB-81
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-81
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: empire-db-2.0.6-incubating
>         Environment: linux (debian) + postgre sql 8.3 and 8.4
>            Reporter: Eike Kettner
>            Assignee: Rainer Döbele
>             Fix For: empire-db-2.1.0-incubating
>
>
> I use postgre sql and getting the next sequence value, the getNextValue() goes into an
endless loop. It fails when updating the sequence value and therefore tries again and again
and again...
> It cannot update the sequence because postgre sql stores milli and nanoseconds within
the timestamp. The WHERE clause from the update omit the milli and nanoseconds. So it tries
to update ... WHERE timestamp='2010-06-10 14:22:24'  but in DB it is '2010-06-10 14:22:24.21231'.
 The update fails and the loop does never stop. It would be great to be informed somehow if
the loop goes beyound some big value.  I did not dig into this deeper, but here is some SQL
excerpt:
> CREATE TABLE wb_sequence_generator
> (
>   seqname character varying(40) NOT NULL,
>   seqtime timestamp without time zone NOT NULL,
>   seqvalue bigint NOT NULL,
>   CONSTRAINT wb_sequence_generator_pkey PRIMARY KEY (seqname)
> )
> WITH (
>   OIDS=FALSE
> );
> insert into wb_sequence_generator (seqname, seqtime, seqvalue) values ('thetest', NOW(),
2);
> select * from wb_sequence_generator;
> Output:
> "thetest"  ;  "2010-06-29 09:39:56.360305" ;  2

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message