1 Reply Latest reply on Jan 27, 2009 8:36 AM by jkronegg

    Help me witth (@Transactional vs. @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW))

    sherkan777
      What is the difference beetwen, both transaction atributes in seam?

      When I add
      @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
      to quartz asynch scheduler, some transactions in scheduler throw exception (no jta transaction) but when I add @Transactional, transaction work corectly...

      Can anybody explain me that, why this happen?
        • 1. Re: Help me witth (@Transactional vs. @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW))
          jkronegg

          According to the book Jboss Seam - Simplicity and power beyond Java EE, page 129, @TransactionAttribute@ is for EJB3 entities, not for POJO enties:



          In EJB3 session beans, you can set the transaction attribute for any method using the @TransactionAttribute annotation. [..] In Seam POJOs, method level transaction demarcation is not available

          If you are using POJO entities and according to this page, the transactions are managed using the transaction manager, configured using the TransactionPhaseListener from faces-config.xml, or by adding the @Transactional annotation to the method.