[hibernate-dev] Sequence Pool

Steve Ebersole steve at hibernate.org
Wed Feb 11 09:23:08 EST 2015

First, this is a list for discussing the development of the Hibernate
projects, not for user/usage questions.

As to your question... Yes 50 was an unfortunately choice as the default
within the spec group.  At the moment there is no global "ignore the
specified increment value" setting, and even though you did not explicitly
specify it the way annotations and the JDK work we have no way of telling

I'd be open to this as a Feature Request.

[1] To code consuming annotations @SequenceGenerator(name="blah") and
@SequenceGenerator(name="blah", increment=50) look exactly the same.  Well,
there is *a* way, but it requires us using Jandex (or similar annotation
processing library) that parses the source representation of the
annotation.  Then @SequenceGenerator(name="blah") and
@SequenceGenerator(name="blah", increment=50) look different in terms of
the value for increment.  I have tentatively scheduled looking at moving to
Jandex for 5.0, or 5.1, or 6.0

On Feb 9, 2015 8:40 AM, "Janario Oliveira" <janarioliver at gmail.com> wrote:

> Hi guys,
> I am migrating some code base and I have some problems using sequence.
> As I see it works with a pool together to allocationSize. But it expects
> that the sequence have the same increment by (50 as default).
> Is there a global configuration that disable pool and always read from the
> sequence?
> In my case scripts are generated manually and everyone will have to
> remember to add increment by 50 or allocationSize = 1.
> Also this would change order creation vs order id.
> e.g.
> If I create 2 rows with hibernate it will keep pooling from 1 to 50. (id 1
> and 2)
> After that some procedure or script can create another one with nextval of
> the sequence. (id 51)
> Next hibernate create another row. (id 3)
> The right order of creation is: 1, 2, 51, 3
> But ordering by id will load a wrong order.
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

More information about the hibernate-dev mailing list