Figured this one out finally, it was my implementation of the
ReplaceElements and not taking into account the copyCache the method
should be:
public object ReplaceElements(object original, object target,
ICollectionPersister persister, object owner,
IDictionary copyCache,
ISessionImplementor session)
{
var result = (ICollection<T>)target;
result.Clear();
foreach (var item in ((IEnumerable)original))
{
var itemToAdd = copyCache.Contains(item) ?
copyCache[item] : item;
result.Add((T) itemToAdd);
}
return result;
}
Cheers
Stefan
On Mar 17, 6:39 am, codemonkey <[email protected]> wrote:
> No difference is made with an evict, as I said it 100% works if I
> don't use my custom collection type.
>
> Cheers
> Stefsn
>
> On Mar 17, 12:05 am, Asher Newcomer <[email protected]> wrote:
>
>
>
>
>
>
>
> > Are you sure this works with other types? You're selecting foo2 from the
> > session, and then trying to merge it back in without evicting it. This is
> > exactly the behavior I'd expect.
> > On Mar 16, 2012 7:52 AM, "codemonkey" <[email protected]> wrote:
>
> > > Hi,
>
> > > My test is as follows:https://gist.github.com/2049742
>
> > > Now the tx.commit after the merge fails with a "a different object
> > > with the same identifier value was already associated with the
> > > session" but if I don't use my custom list type it works fine. Have I
> > > missed something obvious here?
>
> > > Cheers
> > > Stefan
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "nhusers" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected].
> > > For more options, visit this group at
> > >http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.