Re: Auditing SQL queries

2009-04-28 Thread Neil Rutherford
I'm trying to implement this, how can you get the old value from the snapshot event? thanks, Neil On 11/02/2009, Andrus Adamchik wrote: > > On Feb 11, 2009, at 1:19 AM, Laurent Marchal wrote: > > > > Yeah i agree that table/field/date/old value/new value is clearer, but it > seems complex to m

Re: Auditing SQL queries

2009-02-11 Thread Laurent Marchal
Ok thanks for the tips ! Andrus Adamchik wrote: On Feb 11, 2009, at 1:19 AM, Laurent Marchal wrote: Yeah i agree that table/field/date/old value/new value is clearer, but it seems complex to me to have old/new values. Currently this can be done by listening to org.apache.cayenne.access.eve

Re: Auditing SQL queries

2009-02-10 Thread Andrus Adamchik
On Feb 11, 2009, at 1:19 AM, Laurent Marchal wrote: Yeah i agree that table/field/date/old value/new value is clearer, but it seems complex to me to have old/new values. Currently this can be done by listening to org.apache.cayenne.access.event.SnapshotEvent on the DataRowStore (this obj

Re: Auditing SQL queries

2009-02-10 Thread Mike Kienenberger
I've done it two different ways in the past depending on what was available in Cayenne at the time. Since Cayenne supports optimistic locking (and thus already stores the previous old value somewhere), getting the old value isn't that big a deal. In Cayenne 1, I used code generation templates an

Re: Auditing SQL queries

2009-02-10 Thread Laurent Marchal
Yeah i agree that table/field/date/old value/new value is clearer, but it seems complex to me to have old/new values. Do you found a good way to do this ? Mike Kienenberger wrote: If you want the sql executed, query logger seems like it might be your best best. For what it's worth, we occasio

Re: Auditing SQL queries

2009-02-10 Thread Mike Kienenberger
If you want the sql executed, query logger seems like it might be your best best. For what it's worth, we occasionally need to go through our audit logs to research why something changed, and if we had to work with raw sql, it'd be pretty hopeless. Breaking things out into table/field/date/old v

Auditing SQL queries

2009-02-10 Thread Laurent Marchal
Hello there, In our product we need to audit all the database modifications (creates, updates, deletes) and log them in an audit table. I see some olds posts in the ML about that and there are solutions for that in cayenne. But i would like to know if somebody have some hints about the bes