I want to implement an audit trail in my application. Basically, I want to
record every database change, in the form "previous value, new value, who
changed it, when".

I want to debate with you the best strategy in terms of minimization of data
transfer between the browser and the server and server operations.

The user accesses a page and gets data from the database on a form. He
changes, say, one textfielnd and submits the form.

We now need to see where changes occurred and record them, and therefore
need the old values and new values.

What do you think of different approaches to this problem? My current ideas
are:

1) Resubmit the first query to get the "oldvalues" on the second submission
and then compare with the new values. Problem I see is that we'll have one
redundant query on each operation (first query to display values to the user
and second query to get the old values again in the database). In large
applications, between the 1st and 2nd queries data may have changed.

2) Have a hidden field for each value on the display form with the oldValue.
Main problem I see is the increased workload on the jsp page - for each
input field we need to manually have a hidden "oldValue" field...

3) Storing the oldObject in session right before the first display page.
Workload increases in Session management, to wisely add and remove these
objects from session.

Can you share your ideas, point different approaches or suggest improvements
on the ones I mentioned?

-- 
View this message in context: 
http://www.nabble.com/Audit-trail---implementation-strategies-tf4692772.html#a13413247
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to