0 Replies Latest reply on May 24, 2008 1:30 PM by Raj Tiwari

    Transaction in injected EJB

    Raj Tiwari Newbie

      Folks,
      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.

      -Raj