3 Replies Latest reply on Dec 7, 2007 8:00 AM by statelessbean

    Seam and ejb3.0 transactions question?

    statelessbean

      Hi,
      I got simple method with annotation:

       @TransactionAttribute(TransactionAttributeType.REQUIRED)
       public String saveOrder() {
       try {
      //block A
      ...
      //Block B
       }
       catch (Exception e) {}
       return "error";
       }
      



      and my em is managed by container

       @In
       protected EntityManager em;
      
       <persistence:managed-persistence-context name="em" auto-create="true"
       persistence-unit-jndi-name="java:/mlmEntityManagerFactory"/>
      


      block A load some entities and calc somethink,
      in block B i force method to get error.
      In this case when I get error there should be whole transaction rolled back, but all changed are saved? Why and how can I roll back when I get some/any error?