[jboss-user] [Beginners Corner] - Sequence ID generator - Advice sought

cbkihong do-not-reply at jboss.com
Wed Jan 14 10:35:30 EST 2009


I'm pretty new to Java EE myself so bear with me and rectify my misunderstandings. I would like to create a component that returns a unique sequence ID, that increments upon each call. As this is just one of the business functionality exposed to Web tier, later on I would like to have the Java EE server hosting those services to be replicated or clustered, so I thought implementing it as an EJB (EJB3) may be suitable to reserve this possibility. Is this a sound choice, otherwise what kind of an architecture do you suggest for this scenario?

The desired behaviour is:

* Scalable (say, through replication) with high availability
* The counter that keeps track of largest seq no. should be persistent (across AS or server shutdown) and should not lose state (no two seq no. ever returned should be identical) at any time
* It seems keeping the counter in database is an overkill (I've tried something similar in the past with some other language and I agree that is not performing well) and I would like the counter persisted in some other way

Any suggestions for me? I intend to deploy on JBoss 4.2.3, JDK6. Thank you.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201835#4201835

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201835

More information about the jboss-user mailing list