When calling Session.merge(entity)
The interceptor's onFlushDirty is called and the previous state for all of the simple properties "as int or string types" correctly passes the previous values, but with a collection the previous value is always the same as the current value!!!!
Also when we try to get the previous value as follow
Code:
IPersistentCollection persistentCollectionObject = (IPersistentCollection)currentState[index];
if (persistentCollectionObject.IsDirty)
{
prevCollectionObject= persistentCollectionObject.StoredSnapshot;
}
we got the same result.
And sometimes when we try to execute Merge method, the onFlushDirty method did not execute...