You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Parthasarathy T <pa...@gmail.com> on 2006/12/15 15:30:43 UTC

Data Auditing

Hi,



I have a requirement to create audit history (in an audit table for every
actual table in the db) when data gets updated. I do not want to write
triggers in the db as the applications is db agnostic. With torque what is
the best way to write the audit logic – should I change the do<action>
methods to perform the audit along with the action?



Any idea will be helpful. Has someone tried auditing implementation like
this in torque?



Thanks,

Sarathy

Re: Data Auditing

Posted by Michael Kaye <mi...@mxtelecom.com>.
Federico Fissore wrote:
>> I have a requirement to create audit history (in an audit table for every
>> actual table in the db) when data gets updated. I do not want to write
>> triggers in the db as the applications is db agnostic. With torque what is
>> the best way to write the audit logic – should I change the do<action>
>> methods to perform the audit along with the action?
> 
> IMHO one nice way is to edit the java classes Bean.java (which extends
> BaseBean.java) and override the method "save" to do something before
> saving
> I do that to update "modified on date" columns
> 

I Know this might be a bit off-topic, but you might want to see if you
can integrate some sort of AOP programming style into your logic -- we
use it to alter modified dates and modified users on beans before we
save to the database, to provide a basic form of auditing in some cases.
Perhaps intercepting the save methods would be cleaner than altering
your Bean.java.

A framework that handles this really easily is the Spring framework.
(www.springframework.org)

Michael


-- 
Michael Kaye
Senior Software Developer
MX Telecom
Tel: 0845 6667778

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Data Auditing

Posted by Federico Fissore <fe...@concept.it>.
Il giorno ven, 15/12/2006 alle 20.00 +0530, Parthasarathy T ha scritto:

> I have a requirement to create audit history (in an audit table for every
> actual table in the db) when data gets updated. I do not want to write
> triggers in the db as the applications is db agnostic. With torque what is
> the best way to write the audit logic – should I change the do<action>
> methods to perform the audit along with the action?

IMHO one nice way is to edit the java classes Bean.java (which extends
BaseBean.java) and override the method "save" to do something before
saving
I do that to update "modified on date" columns

hth

fede
-- 
Concept - shaping technology 

Federico Fissore  
Developer 
federico.fissore@concept.it 
http://www.concept.it   

Concept S.r.l - via F.Tamagno, 3 - 20124 - Milano 
tel: +39 0229536401 
fax: +39 0220402984 
  
E-Mail Disclaimer 
This message contains confidential information and is intended only for
the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
contain viruses. The sender therefore does not accept liability for any
errors or omissions in the contents of this message, which arise as a
result of e-mail transmission.

If verification is required please request a hard-copy version. 
Concept Srl, via F. Tamagno,3 - 20124 Milan - Italy - www.concept.it 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org