title: Data not getting inserted into audit tables in Spring-Hibernate-envers webapp
body: <p>I am working on a Spring and Hibernate web app. I have to use Envers for auditing.<br>
  But when I am running the application only audit tables are created but no data is inserted to the audit tables.   </p>
  
  <p>Config file:</p>
  
  <pre><code>&lt;mvc:annotation-driven/&gt;
  
  &lt;bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
    &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
  &lt;/bean&gt;    
  &lt;bean name="callbackHandler" class="org.hibernate.ejb.event.EntityCallbackHandler" /&gt;
  &lt;bean name="auditEventListener" class="org.hibernate.envers.event.AuditEventListener" /&gt;
  &lt;bean name="ejb3PostInsertEventListener" class="org.hibernate.ejb.event.EJB3PostInsertEventListener"&gt;
    &lt;property name="callbackHandler"&gt;&lt;ref bean="callbackHandler"/&gt;&lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean name="ejb3PostUpdateEventListener" class="org.hibernate.ejb.event.EJB3PostUpdateEventListener"&gt;
    &lt;property name="callbackHandler"&gt;
      &lt;ref bean="callbackHandler" /&gt;
    &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean name="ejb3PostDeleteEventListener" class="org.hibernate.ejb.event.EJB3PostDeleteEventListener"&gt;
    &lt;property name="callbackHandler"&gt;
      &lt;ref bean="callbackHandler" /&gt;
    &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="sessionFactory" name="sessionFactory"
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
    lazy-init="false"&gt;
    &lt;property name="dataSource" ref="dataSource" /&gt;
    &lt;property name="annotatedClasses"&gt;
      &lt;list&gt;        
        &lt;value&gt;foo.bar.Person&lt;/value&gt;
      &lt;/list&gt;
    &lt;/property&gt;
  
    &lt;property name="hibernateProperties"&gt;
      &lt;props&gt;
        &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/prop&gt;
        &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
        &lt;prop key="hibernate.max_fetch_depth"&gt;2&lt;/prop&gt;
        &lt;prop key="hibernate.default_batch_fetch_size"&gt;8&lt;/prop&gt;
        &lt;prop key="hibernate.jdbc.batch_size"&gt;20&lt;/prop&gt;
        &lt;prop key="hibernate.jdbc.batch_versioned_data"&gt;20&lt;/prop&gt;
        &lt;prop key="hibernate.generate_statistics"&gt;true&lt;/prop&gt;
        &lt;prop key="hibernate.jdbc.fetch_size"&gt;100&lt;/prop&gt;
        &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt;
      &lt;/props&gt;
    &lt;/property&gt;
    &lt;property name="eventListeners"&gt;
      &lt;map&gt;
        &lt;entry key="post-insert"&gt;
          &lt;list&gt;
            &lt;ref bean="ejb3PostInsertEventListener" /&gt;
            &lt;ref bean="auditEventListener" /&gt;
          &lt;/list&gt;
        &lt;/entry&gt;
        &lt;entry key="post-update"&gt;
          &lt;list&gt;
            &lt;ref bean="ejb3PostUpdateEventListener" /&gt;
            &lt;ref bean="auditEventListener" /&gt;
          &lt;/list&gt;
        &lt;/entry&gt;
        &lt;entry key="post-delete"&gt;
          &lt;list&gt;
            &lt;ref bean="ejb3PostDeleteEventListener" /&gt;
            &lt;ref bean="auditEventListener" /&gt;
          &lt;/list&gt;
        &lt;/entry&gt;
        &lt;entry key="pre-collection-update"&gt;
          &lt;ref bean="auditEventListener" /&gt;
        &lt;/entry&gt;
        &lt;entry key="pre-collection-remove"&gt;
          &lt;ref bean="auditEventListener" /&gt;
        &lt;/entry&gt;
        &lt;entry key="post-collection-recreate"&gt;
          &lt;ref bean="auditEventListener" /&gt;
        &lt;/entry&gt;
      &lt;/map&gt;
    &lt;/property&gt;   
  &lt;/bean&gt;
  </code></pre>
  
  <p>I am using <code>@Transactional</code> annotation in service classes.
  Thanks in advance.</p>