3 Replies Latest reply on Nov 14, 2008 8:49 PM by steffi.stephanie.stroka.salzburgresearch.at

    Seam transaction manager : use of ejb-transaction?

    fcousin

      Hello,


      I have trouble understanding the reference documentation My Link. Especially these words : If you are working in a Java EE 5 environment, you should install the EJB synchronization component in components.xml: <transaction:ejb-transaction />


        • 1. Re: Seam transaction manager : use of ejb-transaction?
          fcousin

          If I am working in an EJB environment, do I always have to install the synchronization component? If not, when do I have to do it? Why? Does the default configuration not work?


          I also read the corresponding chapter in Seam in Action, but I still fail to understand this.


          What did I miss?


          Thans for your help.


          Florence.

          • 2. Re: Seam transaction manager : use of ejb-transaction?
            fcousin

            Sorry, the link to the documentation is bad : it's here .

            • 3. Re: Seam transaction manager : use of ejb-transaction?
              steffi.stephanie.stroka.salzburgresearch.at

              You do not need to implement a synchronization component (actually when you have seam managed transactions). As I understood, you have the possibility to give further instructions  for transaction handling with a synchronization implementation, when


              <transaction:ejb-transaction>



              is installed, but commit and rollback actions to the database are still managed by Seam.


              In the case of our application, we have ejb-transactions enabled and we use it to apply revision management. We get a javax.transaction.UserTransaction by doing a jndi lookup on java:comp/UserTransaction, we store transaction data like updates in another bean which we map to the current transaction and we register a synchronization



              ((UserTransaction) Component.getInstance("org.jboss.seam.transaction.transaction", 
              ScopeType.EVENT) ).registerSynchronization(sync)





              which implements beforeCompletion and afterCompletion methods.