What about java.rmi.server.UID? It has a hashCode() method that returns an
integer.
-----Original Message-----
From: Peter Routtier-Wone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 11:45 AM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Writing a finder which returns max id used
> You can also use the facilities of the database engine to help with this
> problem. Oracle has sequences which guarantee a unique number even with
> concurrent access. Sybase has autoincrement columns.
Use of the database as a UID dispenser has its merits with respect to the
concurrency issue, but it raises portability issues.
Another possibility is one of the few really good ideas to come out of
Redmond - the GUID.
GUIDs are unique in space and time. The first eight bytes are a machine
identifier (based on the MAC address of your network interface, if I
remember correctly) and the second eight bytes are a timestamp. The benefit
of this approach is that it is not necessary to contact any other computer
to derive a unique value. The downside is that string comparisons - and
worse yet string based indexes - are *expensive*. But they are seldom as
expensive as contacting another machine, or rolling back and re-running a
transaction.
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user