What is the id being used for (Primary key in DB)? Than how are you accessing the db straight jdbc or something else like CMP or Hibernate? JBoss has built in facilities to generate UUID's.
Oh yeah probably not the best place for this post. Sorry.
>>What is the id being used for
Not sure sorry - i'm really asking the q on someone else's behalf!
>>Oh yeah probably not the best place for this post. Sorry.
What would a better one be?
If you want a home made solution, you can always create a UUID table in your database.
Create one field with the name and one field with
You can implement a cmp, bmp or session bean to read the table, increase value and update.
By creating a generic interface and a factory class you can make several implementations. You can for example take advantage of Oracle sequences in one of your implementations.
Generic methods could be:
setValue(String name, int val);
This can be a nice solution, but it will of course
give a certain overhead you should be aware of.
By looking up Ids in the beginning of a transaction you can create nice asynchronous B2B solutions that can handle a very high temporary load (preliminary check of request data and id sent back as transaction id for later reference).