-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Not sequencial sequence with postgresql
PostPosted: Wed Mar 29, 2006 5:57 am 
Beginner
Beginner

Joined: Thu Dec 16, 2004 11:54 am
Posts: 26
Location: Brussels, Belgium
Hibernate version 2.1

Database we are using is PostgreSQL 8.0.1

We had our server restarted yesterday (we don't know yet how that restart occured, maybe power failure...?) and the first order placed after the reboot had a +32 offset on the sequence...
Could it be that hibernate request a "pool" of id from a sequence and doesn't do a select on each insert as stated in the documentation?
Thanks,
Alex


Top
 Profile  
 
 Post subject: ?
PostPosted: Wed Mar 29, 2006 12:58 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Could it be that your sequences in the DB were created with CACHE 32 parameter?

http://www.postgresql.org/docs/8.1/stat ... uence.html

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 3:49 pm 
Beginner
Beginner

Joined: Thu Dec 16, 2004 11:54 am
Posts: 26
Location: Brussels, Belgium
Well it was not... initially at least. Since the whole database has been moved to newer version since.
I've looked up though, and it is still not.
Code:
SELECT * FROM orders_id_seq;
sequence_name | last_value | increment_by |      max_value      | min_value | cache_value | log_cnt | is_cycled | is_called
---------------+------------+--------------+---------------------+-----------+-------------+---------+-----------+-----------
orders_id_seq |      33634 |            1 | 9223372036854775807 |         1 |           1 |      32 | f         | t     


I couldn't find anything about the log_cnt column though... Has to do with WAL log, but I admit not to know more...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.