-->
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.  [ 3 posts ] 
Author Message
 Post subject: Table generator reconfiguration to avoid ID "Jumps"
PostPosted: Fri May 02, 2008 8:01 am 
Newbie

Joined: Fri May 02, 2008 7:40 am
Posts: 5
Hi All,

I have been using Hibernate 3.2.4 in my application over MSSQL Server 2005 with a rather default ID generation declared like:

Code:
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE)
    private Long id;


The IDs are generated just fine, however every time the application loads, the IDs "jump" by 32768. I read a little bit about the HiLo generator and saw this is by default but I would still like to ask: is there any way to reconfigure the generator to not make this jump (e.g. configure MAX_LO to be smaller)?

I have found online several hbm example that seem to make it but is there a reasonable way to do it via the JPA annotations?

Thanks in advance.


Top
 Profile  
 
 Post subject: suggestion
PostPosted: Sun May 04, 2008 3:55 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
Did you try the 'allocation-size' property of the annotation?


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 04, 2008 1:27 pm 
Newbie

Joined: Fri May 02, 2008 7:40 am
Posts: 5
Well, I did today and this does seem to work...I guess I ran to find sophisticated solutions, forgetting the simple things.

Thanks a lot!


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