• 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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!