4 Replies Latest reply on Sep 2, 2010 5:53 PM by onecent

    PersistenceContextType.TRANSACTION or EXTENDED

    onecent

      Hi there

       

      Thats maybe a stupid question but i'm lost at the moment.

       

      I'm trying out Hibernate 3.5.1 with the @Audited annotation. With EXTENDED it works like i expect -  insert, update and delete are in the audit table. As soon as i switch to TRANSACTION i can only see the insert in the audit table, but no update or delete. Any hint what i should read to understand the problem?

       

      Cheers, Reto

        • 1. Re: PersistenceContextType.TRANSACTION or EXTENDED
          adamw

          That's really weird, no idea why it would happen. You can check if the AuditEvenListener is called when doing modifications in TRANSACTION mode and if so, if the jobs are enqueued and completed in before transaction completion.

           

          Adam

          • 2. Re: PersistenceContextType.TRANSACTION or EXTENDED
            onecent

            Hi Adam

             

            Thank you for your fast answer. It helped a lot to know that it should work. I think i drilled it down to a "transaction" problem in my code. I added a flush() after the persist(subject) is and now it works again. For me it looks like the "hidden" flush() before was out of "scope" when making a update. But i have to invest more time to understand how and why it works ;-)

             

            Cheers, Reto

            • 3. Re: PersistenceContextType.TRANSACTION or EXTENDED
              adamw

              Maybe you have flush mode type manual?

               

              Adam

              • 4. Re: PersistenceContextType.TRANSACTION or EXTENDED
                onecent

                Sorry for the late answer.... ;-). The problem was gone after i installed new versions and did make some changes in our framework. Thank you for your help. At the moment we try and look what envers can do for us ;-). Its a lot different then our own framework for bitemporal data storage (implemented in smalltalk).

                 

                Cheers, Reto