-->
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: sequence generator implementation
PostPosted: Wed Oct 06, 2004 9:03 am 
Newbie

Joined: Mon Sep 27, 2004 4:21 am
Posts: 1
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!


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.