-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Envers configuration with hibernate.cfg.xml
PostPosted: Wed May 25, 2011 3:54 pm 
Newbie

Joined: Wed May 25, 2011 3:45 pm
Posts: 1
I am trying to use Envers to audit the updates/inserts into my tables. I have created audit tables with extension _AUDIT in the DB.

But when I actually run the application, I dont see any entries in the audit tables. I even have no errors or exceptions thrown. Entries are being inserted into the main tables but the AUDIT tables are not updated.

Here is my ENVERS configuration :

hibernate.cfg.xml:

<!-- Hibernate ENVERS Configuration -->
<property name="org.hibernate.envers.audit_table_suffix">_AUDIT</property>
<property name="org.hibernate.envers.revision_field_name">REVISION_ID</property>
<property name="org.hibernate.envers.revision_type_field_name">REVTYPE</property>
<property name="org.hibernate.envers.do_not_audit_optimistic_locking_field">true</property>
<property name="org.hibernate.envers.default_schema">ROCC</property>

<!-- Hibernate ENVERS Listener Configuration -->

<listener class="org.hibernate.envers.event.AuditEventListener" type="post-insert"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-update"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-delete"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-update"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-remove"/>
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-collection-recreate"/>


My table is as follows:

/**
* Transaction generated by hbm2java
*/
@Audited
@Entity
@Table(name = "TRANSACTION", schema = "ROCC")
public class TransactionTable implements java.io.Serializable{...}

The Audit table is TRANSACTION_AUDIT in the same schema.

Can any one tell me why the auditing is not working?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.