[jboss-user] [EJB/JBoss] - Problem with transaction management.

trouby do-not-reply at jboss.com
Wed Nov 26 15:00:38 EST 2008


Hey,

I have a stateless EJB3 class that configured with a timer,

When the timer times out, it invokes several methods,
At the end, it perform some modifications via EntityManager and commits the transaction,


My problem is that in the middle of that long running method that times out, I have a some 'plugins' that loads other EJBs via the InitialContext, 

When one of the methods in the loaded EJBs throw exception, it seems like the container rollback the transaction,

When the failure thrown to the original method and tries to perform some modifications in the database via EntityManager, I get the following error:


  | 23:13:38,858 ERROR [TimerImpl] Error invoking ejbTimeout:javax.ejb.EJBException: javax.persistence.TransactionRequiredException: Entity
  | Manager must be access within a transaction
  | 


If non of the internal ejbs throw exceptions everything works properly and the long running method succeed to perform database modifications



I guess nested transactions are not supported, is there any other way to handle such a situation?



Thanks in advanced,


Asaf.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192625#4192625

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192625



More information about the jboss-user mailing list