probably it is assumed that any user specific or say application specific
Exception is thrown by a programmer for known reason so he can make commit
or rollback in " <your-own>Exception "  as and if required but Programmer's
are not given the flexibility to throw RemoteException(instead have to
throw EJBException) and only Container can throw it so in that case
rollback is Containers job and not Programmers.
***********************
enJoy Life with Technology
***********************
pirbhu




                    "Johan Eltes"
                    <johan.eltes@callista        To:     "krithikav" 
<[EMAIL PROTECTED]>,
                    .se>                         <[EMAIL PROTECTED]>
                    Sent by:                     cc:
                    owner-ejb-interest@ja        Subject:     RE: Rollback in CMT
                    va.sun.com


                    04/26/01 09:33 PM





This is kind of hard to...
1) ...understand by reading the spec
2) ...to motivate

...but it conforms to EJB 1.1.

Runtime exception originating from application code -> Container rollback
None-runtime exceptions originating from application code -> Container
commits.

So far, I haven't found one single situation, when I would like an
exception
to commit a transaction. Does someone have an idea about the rational of
this behaviour (the transactional semantics for application exceptions)?

Just to avoid misunderstanding:

A RemoteException is not a runtime exception, but it has special treatment
by the container. If you derive an exception from RemoteException, I
suppose
your container classifies it as any application exception. The EJB 1.1.
spec
recommends you to throw EJBException, instead of remote exception.

/Johan

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of krithikav
Sent: den 26 april 2001 16:56
To: [EMAIL PROTECTED]
Subject: Rollback in CMT
Importance: High

Hi,
When I throw a remoteexception from my EJB which has Container Managed
Transaction, the
container rollsback the database updates. However if I derive an Exception
class from the
RemoteException and throw the same from my EJB, the container does not
rollback the transaction. Why is this so? Or am I making some mistake?

Regards,
Krithika

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