-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hilo Algorithm
PostPosted: Fri Apr 11, 2008 8:47 am 
Newbie

Joined: Fri Apr 11, 2008 8:34 am
Posts: 2
Hi All,

This is my first posting.

We are using Hibernate 3 ,Spring 2 and Mysql 5.
The problem is for Id generator we are using hilo algorithm and the primary key generated is very high, the id is not in sequence it keeps on jumping high. the ids are as high as 8 digits.

For ex: 26568934,26768934,26968934

these numbers keep on jumping by around 20000.

Not sure why is this happening.

I am afraid if these numbers keep on jumping, all numbers might get exhausted.

Any pointers on this issue ?

Thanks
Sandeep


Top
 Profile  
 
 Post subject: Re: Hilo Algorithm
PostPosted: Fri Apr 11, 2008 9:55 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
What's the HiLo configuration? Remember with HiLo generation, HB reserves a range of ids each time it starts or it runs out of ids and you lose that range if the application restarts. Therefore, it makes a lot of sense in test environments if HiLo generated ids are big numbers. However, the amount HB reserves is (should be) configurable and you might want to set that to a small number in a test environment.


Farzad-


Top
 Profile  
 
 Post subject: Re: Hilo Algorithm
PostPosted: Fri Apr 11, 2008 9:59 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
You may want to look at this: http://forum.hibernate.org/viewtopic.php?t=929583&sid=96a22fa6a94faaaa4601b5074e95ce0b


Farzad-


Top
 Profile  
 
 Post subject: Re: Hilo Algorithm
PostPosted: Mon Apr 14, 2008 4:43 am 
Newbie

Joined: Fri Apr 11, 2008 8:34 am
Posts: 2
hi Farzad,

thanks for your reply.

Can you point me to some documentation which explains how Hilo works ?

Also, if its reserves a range of ids each time then will it again go back to the non-used ids ?

for eg: if it starts with say 250000 and moves forward and at somepoint if all numbers get exhausted, will get use the numbers below 250000 this time?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.