Frank,

I have found that it is the easiest to use a UUID that combines
the time with some random number in a java Long object. These values are
so ridiculously big that it is almost impossible to get a duplicate key,
but of course you have to make arrangements in your code to catch the
DuplicateKeyException and generate a new key, but I can assure you that
this will not happen often...

Joost.

-----Original Message-----
From: Frank Morton [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 15, 2001 7:40 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] cmp primary key


I'm a newbie for sure, but I've been surfing around for
a solution to assigning unique primary key values with
CMPs. I have seen lots of vague descriptions of how
to do it and some specific ones that are all followed by
other comments from people why that solution doesn't
work.

Does anyone have a specific solution and the complete
code to do this they can share? This seems like it must
be a very common problem that ought to have a standard
solution.

Help. I'm really getting frustrated.

Frank



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to