-->
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: Hibernate Sequence problem, GenerationType.AUTO
PostPosted: Thu Apr 17, 2008 7:49 am 
Newbie

Joined: Tue Jan 15, 2008 7:57 am
Posts: 2
Hibernate version: 3

Name and version of the database you are using: Oracle 10

All,

I have a real problem with hibernate sequence. The developer before me used one hibernate_sequence for ids in all tables (GenerationType.AUTO). The problem is it's a system logging customer usage, inserting thousands of rows a day. Because all rows share the same sequence in Oracle, ids are growing really fast and in few months will hit maximum value for Java Integer and whole system will fall over.

Has anyone before dealt with problem like that? Perfect solution would be to use another kind of GenerationType strategy - one that would reset indexing in each table and used only id's not used for the table. What I mean is:

existing table:
ID
2
234
543
777
1087

hibernate would than insert new rows with ids 1, 3...233, 235 etc.

What I would like to avoid is... reindexing all database. That could end up in a really big mess.

I welcome all ideas of resolving the problem.

Thanks in advance
Michal Kunysz


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.