-->
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: Hibernate Envers 3.5.6-Spring 3 & JPA-No Audit Tables & Entr
PostPosted: Fri Apr 20, 2012 2:57 am 
Newbie

Joined: Fri Apr 20, 2012 2:54 am
Posts: 1
I am using hibernate Envers (version 3.5.6) with JPA and Spring 3. I have below setting in my spring settings (applicationcontext.xml)

<bean id="enversListener" class="org.hibernate.envers.event.AuditEventListener"/>
<bean id="mySessionFactory"class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="packagesToScan" value="com.wipro.edo.entities" />
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
hibernate.connection.pool_size=10
hibernate.temp.use_jdbc_metadata_defaults = false
hibernate.show_sql = true
hibernate.hbm2ddl.auto = update
</value>
</property>
<property name="eventListeners">
<map>
<entry key="post-insert">
<ref local="enversListener"/>
</entry>
<entry key="post-update">
<ref local="enversListener"/>
</entry>
<entry key="post-delete">
<ref local="enversListener"/>
</entry>
<entry key="pre-collection-update">
<ref local="enversListener"/>
</entry>
<entry key="pre-collection-remove">
<ref local="enversListener"/>
</entry>
<entry key="post-collection-recreate">
<ref local="enversListener"/>
</entry>
</map>
</property>
</bean>

In the logs , I do see org.hibernate.envers.DefaultRevisionEntity getting called. I do not see the AuditEventListener getting initialized, the audit tables are also not getting created inspite of having hibernate.hbm2ddl.auto = update as mentioned above. In terms of the jars , I use :

1.hibernate-core-3.5.6-Final.jar
2.hibernate-entitymanager-3.5.6-Final.jar
3.hibernate-envers-3.5.6-Final.jar
4.hibernate-jpa-2.0-api-1.0.0.Final.jar

When I insert/update any @Audited entity, I do see the audited tables being mentioned as being binded by the hbmbinder :
19.04.2012 20:13:36 *DEBUG* HbmBinder: Mapped property: REVTYPE -> REVTYPE (HbmBinder.java, line 1335)
19.04.2012 20:13:36 *DEBUG* HbmBinder: Mapped property: REVTYPE -> REVTYPE (HbmBinder.java, line 1335)
19.04.2012 20:13:36 *INFO * HbmBinder: Mapping class: com.wipro.edo.entities.EDOPermission_AUD -> tbl_Permission_AUD (HbmBinder.java, line 348)
19.04.2012 20:13:36 *INFO * HbmBinder: Mapping class: com.wipro.edo.entities.EDOPermission_AUD -> tbl_Permission_AUD (HbmBinder.java, line 348)

I do not see the audit tables nor the entries in the database, would be great if anyone can offer a clue.Please do also let me know if more information is needed.


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.