empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eike Kettner (JIRA)" <empire-db-...@incubator.apache.org>
Subject [jira] Created: (EMPIREDB-81) endless loop in DBSeqTable#getNextValue()
Date Tue, 29 Jun 2010 07:48:51 GMT
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

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

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)

insert into wb_sequence_generator (seqname, seqtime, seqvalue) values ('thetest', NOW(), 2);
select * from wb_sequence_generator;

"thetest"  ;  "2010-06-29 09:39:56.360305" ;  2

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

View raw message