My opinion is that JOnAS should prevent creation of duplicate entities, but I think it 
doesn't and I do not know what EJB
specs tell about this.


> Hi,
>
> I am developing an entity bean with CMP whose primary key is a String value.
> I want that the client get the DuplicateKeyException when it tries to create
> a bean instance with an existing primary key value.
>
> First I assumed that the container would call findByPrimaryKey() before
> calling ejbCreate(), which does not seem to be the case. Then I decided to
> try to find an existing instance in ejbCreate(), handle the FinderException
> and throw a DuplicateKeyException if an instance is found. This works but I
> don't know if it is the right way to do it or if it's just a hack?
>
> Your opinion about this?
>
> Regards,
> Samuel
>
> ======================================
> Creating Opportunities for the Mobile Generation
>
> Samuel Rouiller
> RIXXO AG Mobile Services
> Industriestrasse 11
> CH-6343 Rotkreuz
> Tel: +41 41 799 69 39
> Fax: +41 41 799 69 30
> Mobile: +41 79 645 11 83
> http://www.rixxo.com
> ======================================
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
>
> To: [EMAIL PROTECTED]

Reply via email to