Hi,
I have a clustered application using JBoss/Hibernate. I have 11 tables, each of which needs a sequence generator. I thought of implementing a sequence table with schema:
Code:
companyId : bigint
tableName : varchar
maxId : bigint
then, when a new id is needed, perform a select to get the current maxId, increment & update (within a single transaction). I would however like to avoid the double SQL statement that this operation incurrs. Does hibernate have any functionality (other than the supplied generator classes) for assigning incrementing ids on a per-table basis? It is desirable to have these ids generated sequentially (1,2,3,4...). Also, it is not an option to use a DB-specific function, as this application must deploy to any Hibernate/Jboss-supported architecture.
Any ideas/comments/suggestions would be greatly appreciated.
Thanks!