1 Reply Latest reply on Jul 17, 2013 9:28 AM by Stephen Coy

    entityManager.executeUpdate() doesn't rollback when datasource's jta = false in standalone.xml

    Wooi Joe Chuah Newbie

      Hi,

       

      I encountered this issue recently and was just wondering why it happens.

       

      So basically we have a Container Managed Service Bean which does the following

       

      part A: some insert/update statements using entityManager.persist/merge

      part B: some delete statements using javax.persistence.Query.executeUpdate() where the instance of javax.persistence.Query is created by the entityManager

      part C: some insert/update statements using entityManager.persist/merge

       

      if an RuntimeException occurs (I threw 1 myself just to experiment), part A and part C rollsback successfully but part B doesn't

       

      Once I changed jta="true" in the standalone.xml then it rollsback fine.

       

      Thanks in advance for any explanations regarding this.