2 Replies Latest reply on Oct 4, 2007 5:14 AM by clemente.cioffi

    Transaction demarcation on EJB3/Seam methods

    clemente.cioffi

      Hi,
      I'm figuring out how to handle the transactions in Ejb3 using in a Seam application.
      In my Ejb3 I injected a Seam-managed Entity Manager .I'm not using the seam-managed transactions.
      I'd like to know If I can use the transaction demarcation(EJB3 annotations) on EJB3 methods.
      In particular I'd like to know if it's possible to create a new transaction during one already active.
      I tried that but It doesn't seem work.

        • 1. Re: Transaction demarcation on EJB3/Seam methods
          thejavafreak

          What kind of transaction demarcation/ annotation do you want to use?

          Doesn't EJB3 by default already demarcate transaction before and after the method is invoked?

          • 2. Re: Transaction demarcation on EJB3/Seam methods
            clemente.cioffi

            HI,
            I'd like using this kind of annotation:

            @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW).

            Consider that I have this situation:

            1)I call a first method of ejb3/seam marked with the above annotation.
            2)Inside that method I call another method that I want starts in a different transaction and then I mark also this method with the same annotation.

            The problem is that there is always a unique transaction and the commit operation is carried out at the end of first method.

            Thanks a lot

            Bye