Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt from ejbcerticate mock exam

 
Pooja Gupta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the answers explanation says " A transaction is not rolled backed by the container as a result of a system exception thrown when the transaction runs with an unspecified transaction context and also when a bean is declared with bean-managed transaction demaraction. "

Now, in HF book (page 534), it's written that container will always roll back the exception once a system exception is thrown. It doesn't say any thing about whether it is BMT/CMT. Which is correct - HF or ejbCertificate exam?

Thanks
Pooja
 
Keerthi P
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be it BMT or CMT, the container always rolls back a started transaction if the bean instance throws a System Exception. The container destroys the instance when a system exception is thrown. There is no point in keeping the transaction open when the instance that started it no longer exists. Makes sense?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!