File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Calling transactional business methods after marking for rollback Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Calling transactional business methods after marking for rollback" Watch "Calling transactional business methods after marking for rollback" New topic
Author

Calling transactional business methods after marking for rollback

Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
Hi,

given following situation:

A client runs in an active transaction that is marked for rollback. Now the client calls a business method of a CMT bean those transaction attribute is one of the following: REQUIRED, SUPPORTS, MANDATORY.

Does anyone know if / where the behavoir of the bean is specified in the specs ?

In the spec some times the term "valid transaction context" is used. Is the transaction context in the scenario above considered "valid" ?


SCJP 5 (98%) - SCBCD 5 (98%)
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402
Hi Ralph,

I think finally I could able to find the spec explanation for your and mine doubt.

See 14.3.8 and 14.4.2.1



The javax.ejb.EJBTransactionRolledbackException and javax.ejb.TransactionRolledbackLocalException are subclasses of the javax.ejb.EJBException. The javax.transaction.TransactionRolledbackException is a subclass of the java.rmi.RemoteException. It is defined in the JTA standard extension.

If a client receives one of these exceptions, the client knows for certain that the transaction has been marked for rollback. It would be fruitless for the client to continue the transaction because the transaction can never commit.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling transactional business methods after marking for rollback