Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling of getRollbackOnly Method

 
Pavan Shahi
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As with ejb core spec page no 347

The container must throw the java.lang.IllegalStateException if the EJBContext.getRollbackOnly method is invoked from a business method executing with the SUPPORTS,NOT_SUPPORTED, or NEVER transaction attribute.

Why in case of SUPPORTS IllegalStateException is thrown if there is a transaction context associated with caller method ?

Thanks
Pavan Kumar
 
Dinuka Arsakularatne
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SUPPORTS does not necessarily have to be invoked with a transaction. It can even be invoked without a transaction. That is why it is said to throw an IlledgaStateException as you cannot be sure if it is associated with a transaction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic