[hibernate-dev] JPA's allocationSize & SequenceHiLoGenerator

Max Rydahl Andersen max.andersen at redhat.com
Fri Nov 23 08:26:35 EST 2007


http://in.relation.to/Bloggers/New323HibernateIdentifierGenerators

> Hi,
> I would like to get some feedback on the SequenceHiLoGenerator impl.
> being used when specifying a value larger than 1 to the allocationSize
> parameter of the @SequenceGenerator annotation.
>
> I am indeed wondering why it isn't simply incrementing the
> sequence.nextval by one until it has consumed all values until
> sequence.nextval + allocationSize...
>
> The reason is two folded:
> 1/ Why would I want to fall back to such large row ids?
> 2/ What if some other system is accessing the sequence to insert row
> in the same table and eventually leads to duplicated values?
>
> Is there actually a good reason to use the HiLo algorithm to implement
> that feature and not the "simple way"? Am I missing something?
>
> Thanks,
> Alexander Snaps
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev



-- 
--
Max Rydahl Andersen
callto://max.rydahl.andersen

Hibernate
max at hibernate.org
http://hibernate.org

JBoss a division of Red Hat
max.andersen at jboss.com



More information about the hibernate-dev mailing list