Envers doesn't insert records

后端 未结 1 1268
天命终不由人
天命终不由人 2021-01-28 07:08

I\'m trying to integrate Envers in my project. I\'m using Hibernate-envers 3.5.5-Final, Hibernate-core 3.5.5-Final, spring 3.0.7.RELEASE.

For DAO Layer, I\'m using a Gen

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-28 07:43

    OK.

    I solved the problem.

    Firstibale, it seems that with the Hibernate-core 3.5.5-Final, we don't need org.hibernate.ejb.event.EJB3PostInsertEventListener, so in our ApplicationContext-config.xml we should have just this config :

    
                       
                       
                             
                     
                        
                         
                       
                        
                         
                       
                        
                         
                       
                        
                         
                       
                        
                         
                         
                       
                    
    

    Secondly, in our case our project uses two transction managers, so for the services annotated @Transactionnal we have to mention the name of the proper transaction manager used, that means that all services should be annotated as @Transactionnal(value="NAME_TX_MANAGER"). The source of this problem is that Envers doesn't work properly if we have an auto-commit (If I understood well its documentation).

    I hope that may be helpful for the other visitors if the face the same difficulties.

    0 讨论(0)
提交回复
热议问题