Hi,
I am planning to use hibernate EmptyInterceptor for performing database auditing.
The idea is: once a record is updated, audit information will be inserted in a separate table. For updates, it should also track old values. (Hence I choosed EmptyInterceptor and also tried PostUpdateEventListener).
Is EmptyInterceptor can be used for such audit requirement. I have refered hibernate reference chapter 12 for this implementation.
Also, I have sessionFactory defined in the config xml file. Using entityInterceptor property, I am setting my implementation of EmptyInterceptor in sessionFactory. Now, this interceptor also requires sessionFactory so that it inserts records in audit table. Here sessionFactory and interceptor requires each other.. and thats the problem.....
Please let me know, in which way I can resolve this. Same issue applies when I use PostUpdateEventListener.
Regards,
Nikam S
|