Skip Headers
Oracle TopLink Developer's Guide
10g Release 3 (10.1.3)
B13593-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Implementing User and Date Auditing with the Unit of Work

Auditing datasource changes is a common requirement: when a user commits a change to the datasource, the application updates a field in the datasource to record the user who made the change and the date.

For example, suppose each row in your database schema includes fields lastUpdateBy (to record the user name of the user who commits a change) and lastUpdateOn (to record the date of the change).

You can use UnitOfWork method setProperty to record the name of the user who acquires the UnitOfWork and implement a descriptor event listener for AboutToUpdateEvent descriptor events that extracts the property and updates the lastUpdateBy and lastUpdateOn fields.

For more information, see the following: