aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Quick question on transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Quick question on transactions" Watch "Quick question on transactions" New topic
Author

Quick question on transactions

Grand Puba
Greenhorn

Joined: Oct 28, 2004
Posts: 11
Does the container always roll-back the transaction (or at least mark the transaction for roll-back)? Even whith BMT beans?


"You don't need eyes to see, you need vision" -- Faithless
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Does the container always roll-back the transaction (or at least mark the transaction for roll-back)? Even whith BMT beans?

What do you mean by "always"? Transactions will only rollback when there are unexpected events happened. For BMT, the container will not help you to rollback the transactions, you need to explicit declare that the transaction is rollback by ut.rollback(), where ut is an object of UserTransaction.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Grand Puba
Greenhorn

Joined: Oct 28, 2004
Posts: 11
Sorry Nick,
I wasn't very clear in my question (I think that's the stress because I have the exam today). I actually ment: Does the container always roll-back the transaction (or at least mark the transaction for roll-back) when a System exception is thrown ?

Sorry for my previous question...
Thx 4 the reply thou
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Quick question on transactions