Look at the Spec. section 12.2.1 which describes an Application Exception
as any exception thrown by the BEANs remote or home interfaces which
is not a RuntimeException, or RemoteException. CreateException,
RemoveException and FinderException are all specialist types of
ApplicationExceptions.

A system exception is anything which extends RemoteException or
RuntimeException,
including EJBException which is a subclass of RemoteException. If an EJB
throws a
system exception this should be converted by the container into a
RemoteException and
passed back to the client.

You should not be explicitly creating RemoteExceptions in your code. Instead
you should
either be throwing ApplicationExceptions, and optionally marking the
transaction for
rollback, or in the event of a system level exception (a serious error like
a JNDI API exception
which cannot be recovered from) throwing an EJBException which triggers a
rollback of the
transaction automatically.

regards

Duncan Alexander

> -----Original Message-----
> From: Mangtani Komal [SMTP:[EMAIL PROTECTED]]
> Sent: 18 September 2000 17:12
> To:   [EMAIL PROTECTED]
> Subject:      Re: [EJB-INT] System vs. Application Exception
>
> IMHO, Application exception is the one which the client program ( the one
> which does lookup for ejbhome..)throws.
> System exception is thrown by your EJB Server which includes all the
> exceptions thrown by your entity/sessionbeans.
> Rgds.,
> Komal.
>
>
>
>
>                     Jeff Sahol
>                     <[EMAIL PROTECTED]        To:
> [EMAIL PROTECTED]
>                     >                        cc:
>                     Sent by: A               Subject:     System vs.
> Application Exception
>                     mailing list for
>                     Enterprise
>                     JavaBeans
>                     development
>                     <EJB-INTEREST@JAV
>                     A.SUN.COM>
>
>
>                     09/18/00 09:27 AM
>                     Please respond to
>                     A mailing list
>                     for Enterprise
>                     JavaBeans
>                     development
>
>
>
>
>
> The Developer's Guide says that "If a system exception is thrown, the
> EJB
> container might destroy the bean instance." It gives some examples of
> system exceptions, but no general rule as to what exceptions should be
> considered "system exceptions." Does anyone know?
>
> Reason I ask is that I plan to rethrow exceptions from the EJB and don't
> want some unanticipated error to end up destroying EJB's, at least not
> without my knowledge.
>
> --
> Jeff Sahol
> [EMAIL PROTECTED]
>
> ==========================================================================
> =
> 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".

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