Re: Original values of an object

[prev] [thread] [next] [Date index for 2005/03/13]

From: Frank Carnovale
Subject: Re: Original values of an object
Date: 23:32 on 13 Mar 2005
FWIW we managed to implement a full audit trail facility for deletes and
inserts.. including reporting 'old' vs 'new' values.. by overriding the
validate_column_values method.   We first call its superclass to
validate, then looop over all $self->get($col) values to compare them
with the column_values hash delivered to that routine.  For has-a's we
take care to compare $val->id rather than $val.  
For a delete audit trail we use the before-delete trigger. 
 
In all cases, we use after_(delete|insert|update) triggers to report
the object id plus an "ok" line into the audit trail just to prove that
all work proceded ok without raising exceptions.

The resulting audit trail has been very successful and has not
introduced any measurable overhead..  for my money it's a great example
of using Class::DBI techniques in preference to more conventional oracle
techniques (triggers on every table).

>>>> tony-cdbitalk@xxxxx.xxx 11/03/05 9:52:50 PM >>>
>On Fri, Mar 11, 2005 at 10:29:44AM +0000, ivor.williams@xxx.xxx
wrote:
>> What I would really like to do is provide an audit trail of the
changes
>> - column name, old value and new value. I can work out which
columns
>> have changed from is_changed, but are the original values stored
anywhere?>

>Not yet. This is one of the things that the new Attributes are meant
to
>allow. But they're not finished yet.

>Tony



                                       

Original values of an object
ivor.williams 10:29 on 11 Mar 2005

Re: Original values of an object
Tony Bowden 10:52 on 11 Mar 2005

Re: Original values of an object
Frank Carnovale 23:32 on 13 Mar 2005

Generated at 08:54 on 14 Mar 2005 by mariachi v0.52