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
|