My system is too fast - it generates several ID's in the same ms. Here's my
(working) version:

    private static int index = 0;

    public static synchronized long makeUnique() {
                return System.currentTimeMillis() * 1000 + index++ % 1000;
    }

Trim it down a bit if you don't like long.

/Per


> -----Original Message-----
> From: Rickard �berg [mailto:[EMAIL PROTECTED]]
> Sent: den 14 september 1999 14:51
> To: [EMAIL PROTECTED]
> Subject: Re: ID attributes in the DD
>
> .. or why not KISS:
> new ID = System.currentTimeMillis()
> which is always unique...
>
> /Rickard, :-)

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to