[jboss-user] [EJB 3.0] - Transaction in injected EJB

rituraj_tiwari do-not-reply at jboss.com
Sat May 24 13:30:30 EDT 2008

I have a SLSB that launches tasks in a threadpool. The task threads need to access entities and persist them.

I am accessing this SLSB by injecting it into another SLSB (which is also a seam component).

My problems are :
1. The moment my threads try to persist anything using the injected EntityManager (org.jboss.ejb3.entity.TransactionScopedEntityManager), it throws an exception saying that a transaction needs to be started

2. If I try to fix the above problem by em.getTransaction().begin(), I get an IllegalStateException saying I cannot do that in a managed and injected entity manager.

Is JBoss really conspiring to keep me from getting my project done :-) ?

Any help will greatly help my sanity.


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

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

More information about the jboss-user mailing list