-->
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.  [ 1 post ] 
Author Message
 Post subject: Enhanced identifier generators
PostPosted: Thu Dec 08, 2011 5:55 am 
Newbie

Joined: Wed Dec 07, 2011 1:57 pm
Posts: 1
I decided to make use of a Hibernate id generator which meet the following requirements: - safe id generation when the domain is accessed from different applications(different JVMs) - make use of id intervals (do not query the database every time a new ID is needed)

After some investigations I choose one of 2 hibernate enhanced identifier generators, it's the

org.hibernate.id.enhanced.TableGenerator

The problem is that this algorithm keep in database not the next value available but the end of the next available interval, so, let's say I have an id generator with increment_size 10, when i make a request for an id I receive the interval 1 - 10, but in the database is now stored not the value 11, but 21. With this behavior I have to keep the increment_size the same along all classes that map to a specific table.
Why it have this behavior ? Is there any way to fix this ?


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

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.