-->
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.  [ 6 posts ] 
Author Message
 Post subject: hilo generator algorithm
PostPosted: Thu Feb 05, 2004 9:43 am 
Newbie

Joined: Wed Dec 17, 2003 11:55 am
Posts: 10
Hi,
I am using the hilo generator class for developing my application.
can anybody help me to know the hilo algorithm.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2004 9:53 am 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Search the forum by keyword before posting !
You would have found: http://forum.hibernate.org/viewtopic.php?t=927625&highlight=hilo


Top
 Profile  
 
 Post subject: further
PostPosted: Thu Feb 05, 2004 10:06 am 
Newbie

Joined: Wed Dec 17, 2003 11:55 am
Posts: 10
Hi thanks in advance,
i am migrating some data in my application. Now the sequence id's that will be generated are from oracle database sequence. After this i will be using my application to work on in which i using the hilo generator.
now i am in a fix if the generated sequences from oracle might clash.
What should i do for this.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2004 10:09 am 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Not sure I understand your problem...

But if you migrate from Oracle where ids are generated from sequences to a database where sequences are not available, then use the increment generator... it will restart at the highest id currently assigned in your DB...

The HiLo may also work provided you initialize it with a value greater than the latest currently used by your Oracle.


Top
 Profile  
 
 Post subject: one more query
PostPosted: Thu Feb 05, 2004 10:33 am 
Newbie

Joined: Wed Dec 17, 2003 11:55 am
Posts: 10
This is just to clear a query i have.
i use hilo generator in my application.
my database is oracle.
i need to do some dynamic updates in the database using a stored procedure.
can i use the same table hilo uses. if i use it then will hilo work without any clashes as i will be updating the next sequence ids using the stored procedure. i will be using row locking through the stored procedure.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2004 10:38 am 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Please read about HiLo to understand how it works...

It will work without any problem as long as you don't use - outside of Hibernate - the range currently reserved by the generator.

If you increment a next value from HI to HI+1, and use the range [HI*max_lo, (HI+1)*max_lo[ everything should be ok.

That's actually the purpose of the HiLo generator: allow concurrent modifications from different applications.


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