The Singleton Entity Bean implementation cannot handle too many calls per
second, because of the overhead associated with access entity beans. Many
people feel that an EJB is overkill for creating UUID's. I agree that a
CORBA or RMI server would be a better approach. If your container supports
easy management of these objects, that would probably be the way to go.

If you wanted to use entity beans to create UUID's, you would gain
portability, easy deployment, and object management. There is also a
compromise whereby you can eliminate the speed issues. In this month's
Software Development magazine
(http://www.sdmagazine.com/uml/thinking/s9912to.shtml), Scott Ambler
discusses the creation of a UUID using a combination of enterprise-wide
sequence numbers and client-generated sequence numbers.

The EJB could return a globally unique UID using the idea that I discussed
before, and the client would increment its own sequence number that is
appended to the bean's number. If you agree that the client's counter
consists of four digits, you would only have to access the bean once per
1000 - 1 keys. There is no reason why the client counter couldn't be sixteen
digits either.

jim

----- Original Message -----
From: Mihir Mehta <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 16, 1999 3:31 PM
Subject: Primary Key


> Hi,
>
>   I have gone through the archive and realized that the two safe options
> for implementing database (Oracle) base primary key generation are
>
>   1. Singleton Entity Bean (BMP)
>   2. Stateless Session Bean
>
> I am going to use Oracle Sequence to generate the primary keys.
>
> Questions :
>
>  1. Which one is better - using a singleton entity bean (BMP) or
>     stateless session bean in terms of performance ?
>
>  2. What are the tradeoffs of using James Cook's UUID generation bean
>     versus a sequence in Oracle database.
>
>     - UUID option generates large ids
>     - Using Oracle Sequence requires accessing the database
>     - How much do large ids affect an application that does a lot of
>       complex queries ?
>
>
> Thanks for your help and suggestions.
>
> Mihir
>
>
===========================================================================
> 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".
>
>

===========================================================================
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