As a matter of fact, I have implemented an audit trail solution with triggers in the past. I am trying to think of an alternative in the business layer now, although implementing it directly in the database is an option if I find this approach to be too troublesome.
Rod Bollinger wrote: > > Depending on the DB you can implement this using triggers and log your > audit > trail directly in the DB itself. > > -Rod > > -----Original Message----- > From: wild_oscar [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 25, 2007 14:36 > To: user@struts.apache.org > Subject: Audit trail - implementation strategies > > > 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 textfield 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] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Audit-trail---implementation-strategies-tf4692772.html#a13413561 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]