Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences

Edit this page


Referenced by
AppFuseSupport




JSPWiki v2.2.33

[RSS]


Hide Menu

DatabaseAudit


Database Auditing

You might want to either audit who has changed the data, or what the specific data changes were. There are a number of options available to you:

  • Use Spring Transaction Manager/Interceptor

Spring should help you do this pretty easily. You would setup a filter/manager at the service layer (extending/implementing the normal transaction manager) that inspects the request and inserts an audit record when appropriate. Then change your service config files to use that manager instead of the transaction manager.

  • Hibernate auditing

Hibernate supports a flexible audit logging mechanism. Check out "Chapter 13 : Interceptors and events" in the Hibernate 3 Reference documentation or "Section 8.3.2 : Audit Logging" in Hibernate in Action for a detailed coverage on topic.

  • Database triggers

A traditional way of auditing what data changes have been made is by using triggers and creating mirror audit tables for any tables you want to audit (ie. user_audit). The triggers will fire when a modification to a record occurs, and write to the audit table, writing the state of the record and who made the modification.

  • Oracle 9i now has auditing features built in
  • You could use log4j to configure a special audit log file and write to that
  • You could software like this that sits between Hibernate and the DB


Go to top   Edit this page   More info...   Attach file...
This page last changed on 06-Nov-2006 13:52:59 MST by BenGill.