aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes query on handling of setRollBackOnly method ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "query on handling of setRollBackOnly method ?" Watch "query on handling of setRollBackOnly method ?" New topic

query on handling of setRollBackOnly method ?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923

couldnt understand following paragraph from ejb 3.1 specs , page 371, sec

If the container initiated the transaction immediately before dispatching the business method to the instance (as opposed to the transaction being inherited from the caller), the container must note that the instance has invoked the setRollbackOnly method. When the business method invocation completes, the container must roll back rather than commit the transaction. If the business method has returned normally or with an application exception, the container must pass the method result or the application exception to the client after the container performed the rollback.

specifically could not understood the bold line ? Please help guys .
Thanks and regards

OCPJP 6(100 %) OCEWCD 6(91 %) OCPJBCD(93%)
Frits Walraven
Creator of Enthuware JWS+ V6

Joined: Apr 07, 2010
Posts: 1520

Hi Gurpeet,

A transaction is either started by the client, or by the container just before invoking a method with a (MANDATORY, REQUIRED or REQUIRES_NEW) transaction attribute.

Note that if the client did not have a transaction: REQUIRED will cause the container to start a new transaction, and if the client did have a transaction: it will just run the method under the existing transaction context.

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923

Thanks a tonne
I agree. Here's the link:
subject: query on handling of setRollBackOnly method ?
Similar Threads
SetRollbackOnly in CMT
Transaction rollback...and being user friendly
Need understanding on Handling of setRollbackOnly invoked from methods with transaction attribute
SessionContext . setRollbackOnly() method doubt.