简体   繁体   中英

Web Application audit trail

I am performing audit trail for a web application of the user id login who perform insert/update/delete of records.

There are no issues for insert / update triggers. However, for delete trigger the database would not know the "user id" who perform the delete.

I am using oracle database and jdbc with connection pooling.

How do I pass the "user id" to the delete trigger?

Take a look at Audit4j . It supports out of the box support for application auditing.

Are you using JPA? If so, are you using EclipseLink? If so, can this be done without triggers?

If you answered yes to all three answers, have I got an answer for you. Take a look at EclipseLink's History table feature . I've used this in the past successfully to implement an audit trail.

Otherwise, consider "soft deletes" by having a Status column. Instead of physically removing the row from the database, you simple set the row status to disabled. In your Select queries, just add "and where status != disabled."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM