-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: audit interceptor
PostPosted: Wed May 10, 2006 8:42 am 
Newbie

Joined: Fri Apr 28, 2006 3:49 pm
Posts: 1
We have an audit system using a hibernate interceptor and triggers. The tables that are audited contain an audit info record containing admin information and a timestamp. These fields are updated in the audit interceptor and the triggers are responsible for archiving the relevant data.

This system is similar to what is outlined here:

http://blog.hibernate.org/cgi-bin/blosxom.cgi/2004/06/19

This works fine for inserts (org.hibernate.Interceptor.onSave) and updates (org.hibernate.Interceptor.onFlushDirty). My question is about deletes. The api documentation for the org.hibernate.Interceptor.onDelete method makes a recommendation not to change the data state:

Quote:
"It is not recommended that the interceptor modify the state."


No further explanation is offered. So, if the state can not be modified, this pattern can not be used for deletes because the audit info can not be added. Going against the recommendation, I have tried adding the audit info in the onDelete method. It caused the delete to be preceded by an update. This may be a performance concern, but it did not seem to cause other problems.

Can anyone provide some insight into why the recommendation is made?

I am using hibernate 3.1.2 and oracle 10.2.

Thanks...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.