I'm attempting to implement audit-logging to keep an eye on every change done. I've implemented a custom inteceptor (stretches from EmptyInterceptor).

I'm overriding the OnFlushDirty method, and also the parsing the previousState and currentState and logging the values. This really is working fine, aside from collections. The issue appears to become the collection is saved like a PersistentSet, and also the object references from the property for previousState and currentState match.

Example:

previousState[i] == currentState[i] //This is true when the item in the state is a collection

Thus, I believe when a product is added/taken off the gathering, the previousState may also be up-to-date. Any applying for grants this? I'd like the previousState to achieve the data because it was, and also the currentState the up-to-date date, for collections.