Error when trying to audit Component Set

Description

I have a class named Body; it has a property named Items, which is a set of BodyItem.

When I try to persist an instance of Body which has only one BodyItem in Body.Items, everything works, and audit data is also recorded. But when I add two different items to Body.Items and try to persist it, an exception is throwed:

NHibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: System.Collections.Generic.Dictionary`2[System.String,System.Object], of entity: ttbl_items_log

If I mark Body.Items with [NotAudited], then I can persist data normally, but (obviously) the audit data for the items is not recorded.

Environment

NHibernate-3.3.3.4001

Attachments

7

Activity

Roger 
August 5, 2014 at 3:44 PM

...or you can simply create your own build at this changeset (eddb067652e8d62bd34d9e0387cb365b712a6b32). It's on 1.x branch.

Roger 
August 5, 2014 at 3:41 PM

This is a duplicate of issue NHE-118. It has already been fixed.

I'm not planning to create any more official 1.x release.

Feel free to backport it to your own build. This changeset will (most probably) fix your issue...
https://bitbucket.org/RogerKratz/nhibernate.envers/commits/eddb067652e8d62bd34d9e0387cb365b712a6b32
...also some breaking change info here....
https://bitbucket.org/RogerKratz/nhibernate.envers/commits/72d39792cf9619d45fb825ce78b1bf71e279182c

João Alexandre de Toledo 
August 2, 2014 at 12:43 PM

With NH-4.0.0.Alpha2 and Envers-2.0.0-Beta3 the problem is gone.

Would it be possible to backport the solution to NH-3.x + Envers-1.x?

Fixed

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created August 2, 2014 at 12:41 PM
Updated August 5, 2014 at 3:44 PM
Resolved August 5, 2014 at 3:39 PM
Who's Looking?