Search code examples
hibernatejpahibernate-envers

How to turn Hibernate Envers (ON / OFF) through persistence XML


In my application, I'm using Hibernate Envers 4.2.12 for creating audit trail module.It's working fine but at sometimes I need to turn audit trail off so can I configure this at persistence XML ?

Note: After search, I found the below properties to disable Hibernate Envers service and I tried it but it not worked

<property name="hibernate.integration.envers.enabled" value="false" />
<property name="hibernate.envers.autoRegisterListeners" value="false"/>

Solution

  • Maybe your property is wrong. Did you try this?

    <property name="hibernate.listeners.envers.autoRegister" value="false"/>