0

I have a situation where I have to maintain History of a table.

For Eg: I have PaymentTransaction Table and I want to keep PaymentTransactionHistory for auditing purposes.

Do we have anything in NHIbernate that can be used to achieve this. I read about IInterceptor and Events and couldn't really understand if they could be of any use in my case.

I am using Fluent NHIbernate.

Many Thanks

2 Answers 2

1

NHibernate Envers may also be an option for you - but possibly an overkill for the usage you mentioned.

1
  • Yes you are right and is the reason why I am trying to avoid using it. I have made it to wotk by using Nhibernate Events. Thanks for your input though.
    – Maverick
    Sep 15, 2014 at 7:34
0

In my project this is done by an interceptor, using following methods:

  • When something got deleted, process it in OnDelete
  • When something inserted into DB, process it in OnSave
  • When something changes, process it in OnFlushDirty
  • There are some other methods for handling collection.

Just try them, it's not difficult.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.