5 Replies Latest reply on May 15, 2009 10:11 AM by Maxence Warzecha

    why transaction is rollbacked? @CreateProcess @Stateless EntityManager

    Maxence Warzecha Newbie

      Hello,


      I have a stateless bean with an EntityManager and one method annoted with @CreateProcess



      @Stateless
      @Name("createMyObject")
      public class CreateMyObjectBean implements CreateMyObject
      {
          @Logger private Log log;
          
          @In
          EntityManager entityManager;
          
          @In
          User currentUser;
       
          @In(create=true)
          MyObject myObject;
      
          @CreateProcess(definition="MyWorkflow", processKey="#{myObject.id}")
          public String createMyObject(String name){
              
                      try{
                              myObject.setName(name);
                              entityManager.persist(myObject);
      
                      }catch (Exception e) {
                              log.error("Exception...");
                              e.printStackTrace();
                              return null;
                      }               
          
                      return "success";
                              
          }
      
          
      }




      In Server log, CreateProcess is intercepted and processed.


      In database log I see insert for MyObject BUT directly after I see a rollback and no trace of jbpm insert.


      I don't understand why transaction is rollbacked.


      I work on Seam 2.1.1.GA and JBoss 5.0.0.GA.


      Do have any idea?
      Thank you.