0 Replies Latest reply on Jan 18, 2010 9:04 PM by Diego Y K

    Exception occurred but the entitys didn't rolled back

    Diego Y K Newbie

      Hi,


      Recently i've noticed that even when hibernates throw a exception, from a contraint for example, the transaction is not being rolling back properly. Part of my entities changes are flushed even when they are changed in the same request.


      I'm using Seam managed persistence unit and ejb-transaction.


      <transaction:ejb-transaction />



      <persistence:entity-manager-factory
         name="entityManagerFactory" 
         persistence-unit-name="sieManagementPool"/>
      
      <persistence:managed-persistence-context
         name="entityManager" auto-create="true" 
         entity-manager-factory="#{entityManagerFactory}"/>



      I tried to check if there is a Transaction calling entityManager.getTransaction() but I got a IllegalStateException. Does that indicates me that I'm actually without transactions?


      If so, how can I fix that? I always thought that a Transaction is on by default on requests inside a EJB. Does Seam changes that?