I am having similar problem as yours. Any solution for CMP beans using
sequences from Oracle for primary key ?

> -----Original Message-----
> From: Lars Hagrot [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 25, 2000 2:23 PM
> To: [EMAIL PROTECTED]
> Subject: Who is generating the key when you are using CMP?
>
>
> When you build a real system ( not a tutorial) you will recognize the
> problem below.
>
> If you have an Entity Bean and use CMP there must  always be a unique
> key.  Where does it come from?
>
> 1) from the "user" (and passed as parameter to the create method)?
> 2) from the EJB-Container or some Session bean (how does it know it is
> unique)?
> 3) from the database ( for example "max(col)" or "identity")?
>
> In 1) and 2)  you can assign the key in the create method.
> But in  3) you must do a query or insert a row to get the key but how
> can I tell the Container do do that. I am supposed to assign
> the key in
> the create method.
>
> Is there any standards for this problem?
> Does this imply that example 3) must be implemented as BMP?
>
> What is the best solution if it has to be scalable and shall work with
> cluster of EJB-Servers?
>
> Regards
>
> Lars Hagrot
>
> --
> Lars Hagrot                      E-mail: [EMAIL PROTECTED]
> Object Technology Mentoring      Phone: +46 8 50714409
> Enea Data AB              Fax: +46 8 658 57 90
> Hornsgatan 166
> S-117 28 Stockholm
> Sweden
>
> ==============================================================
> =============
> 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