-->
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.  [ 2 posts ] 
Author Message
 Post subject: Envers and bidirectional relationship auditing
PostPosted: Tue Sep 04, 2012 6:17 am 
Newbie

Joined: Tue Sep 04, 2012 5:01 am
Posts: 1
Hi,

We're using envers 3.6.10.Final as our auditing solution. I have a question about the way envers audits the other side of a bidirectional relationship regardless of whether any changes have been made to it.

For example :

I have a simple many-to-many bidirectional relationship between Person and DistributionList

When persisting a DistributionList with a collection of Person, envers audits the DistributionList entity, the join table but also the Person entity.

This means that when we inspect audit information on the Person entity, (forRevisionsOfEntity method), we find that there is a revision every time a person has been added/removed from a DistributionList. Consequently, when displaying audit information for the Person entity, numerous revisions are exactly the same.

Is there anyway to stop envers from doing this? targetAuditMode=RelationTargetAuditMode.NOT_AUDITED seems to have zero effect on what is written to the audit tables.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Envers and bidirectional relationship auditing
PostPosted: Thu Jan 17, 2013 6:24 am 
Newbie

Joined: Thu Jan 17, 2013 6:13 am
Posts: 1
Hi,

I had the same problem with a bidirectional many-to-many relation. My case was actually vene worse because one of the classes was abstract with a discriminator value.
The instances of this abstract class were audited when I added the class to the other's collection, but the discriminator showed the wrong value.
I was able to fix it by specifying NotAudited on one side of the many-to-many relation, and keeping the auditing on the owning side.
Hope this helps. BTW, we are using hibernate envers 3.6.9.

Regards,

Frank.


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

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.