edla,
i believe the DuplicateKeyException was conceived
as a pointer to help users figure out why a create()
failed. (and there can be quite a number of reasons,
the most common ones being a duplicate primary key
in which case you would receive a DuplicateKeyException
and violation of some constraint ... say a unique/not-null
etc where you would just receive a CreateException)
if you look at CMP (entity beans), by default, EJB 1.1
compliant vendors check for the existence of a row
with that primary key before creating one. The same
is done in 'clean' BMP implementations as well.
of course, checking for a row with that primary key
before creating it is nice, but since your database will
not permit a duplicate entry, you might find it redundant
and even slow. The Borland AppServer for example
has a flag along the lines of 'checkExistenceBeforeCreate'
which can be turned off (its on by default) .. and maybe
other ejb vendors provide a similar option as well.
-krish
----- Original Message -----
From: E Bakka Reddy <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 21, 2001 11:34 AM
Subject: Application Exceptions
> Hi,
>
> I am going through the Application Exceptions topic from O' Reilly, 2nd
> edition, 1.1 specs, written by Richard Manson-Haefel.
>
> Chapter 8: Transactions, page no. 315, sub heading CreateException: here
he
> was written that CreateException is thrown by the create() method in the
> remote interface, also the same thing repeated under the sub heading of
> DuplicateKeyException extends CreateException.
>
> Please, throw u comments on it.
>
> Thanks & Regards,
> Edla B. Reddy
>
>
===========================================================================
> 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".