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

non-trans method question;

 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

Here is my question:

"Invoking a non-transactional method (while the bean is in the METHOD-READY-IN-TX state makes the EJB container to throw an error to the client."

Could you please explain this further to me ?

Tks.
 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Felipe,

The reason is in the specs 4.4.4:
If a session bean instance is participating in a transaction, it is an error for a client to invoke a method on the session object such that the transaction attribute specified in the bean�s metadata annotations and/or the deployment descriptor would cause the container to execute the method in a different transaction context or in an unspecified transaction context. In such a case, the javax.ejb.EJBException will be thrown to a client of the bean�s business interface.


In other words:

You cannot change the transactional context of a stateful session bean (for another or null context) if it is already involved in a transaction.
It's true for all stateful session bean wether it implements SessionSynchronization or not.

Hope it helps...

Beno�t
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic