1 Reply Latest reply on Mar 5, 2014 9:14 AM by Scott Marlow

    Is @javax.transaction.Transactional supported in WildFly by default?

    Richard Yang Apprentice

      If I have a ApplicationScoped bean, what jta transaction (CMT) I can use? I know I can use @Stateful, but how about @javax.transaction.Transactional? I am using EE7. Also, for beans with no scoped defined, what JTA annotation I can use other than @Stateless?

      Does @TransactionManagement itself work? I tried it does not seem to work. But do not know why?

      Also, is there entended entity manager available for conversationscoped jsf beans?

       

      Thanks.

        • 1. Re: Is @javax.transaction.Transactional supported in WildFly by default?
          Scott Marlow Master

          You might find it helpful to enable TRACE logging for com.arjuna + org.jboss.as.jpa so that you can see the impact (e.g. JTA transactions starting/suspending/resuming/ending) of different settings. 

           

          The extended entity manager is only available for (EJB) stateful session beans.  You could try using an application managed entity manager instead.  Basically, you inject an @PersistenceUnit into EntityManagerFactory and get an EntityManager from the EntityManagerFactory.  Be careful not to share the EntityManager between multiple threads as it is not thread safe.  The EntityManagerFactory can be shared between threads.  Don't forget to close the EntityManager when your done with it and clear your reference to it.

          1 of 1 people found this helpful