Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 183565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:08:20+00:00 2026-05-11T15:08:20+00:00

I found couple of discussion threads on this- but nothing which brought a comparison

  • 0

I found couple of discussion threads on this- but nothing which brought a comparison of all three mechanism under one thread.

So here is my question…

I need to audit DB changes- insert\updates\deletes to business objects.

I can think of three ways to do this

1) DB Triggers

2) Hibernate interceptors

3) Spring AOP

(This question is specific to a Spring\Hibernate\RDBMS- I guess this is neutral to java\c# or hibernate\nhibernate- but if your answer is dependent upon C++ or Java or specific implementation of hibernate- please specify)

What are the pros and cons of selecting one of these strategies ?

I am not asking for implementation details.-This is a design discussion.

I am hoping we can make this as a part of community wiki

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:08:20+00:00Added an answer on May 11, 2026 at 3:08 pm

    I only can talk about Triggers and NHibernate, because I don’t know enought abou tSpring AOP.

    It depends on, as always, what is most important for you.

    DB triggers

    • are fast
    • are always called, even from native SQL, Scripts, external apps.
    • write data in the DB of which NH doesn’t know about. It will be missing in the current session. (Which could lead to unexpected results)
    • do usually not know anything about your session (say: login name).

    NHibernate interceptors / events

    • are not DBMS specific.
    • allow you easy access to you business information, like the user session, client machine name, certain calculations or interpretations, localization, etc.
    • allow you declarative configuration, like attributes on the entity, which define if the entity needs to be logged and how.
    • allow you turning off logging, this could be important for upgrades, imports, special actions that are not triggered by the user.
    • allow you an entity view to the business model. You are probably closer to the users point of view.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found couple of difference frameworks which can test Android apps, but all of
I found a couple of threads that touch on development of C#/Java apps but
I found a couple questions similar to this, but not specifically for .NET projects,
I've found a couple questions about this on here, but can't find a solution.
Found a couple of similar questions here on this, but couldn't figure out how
Found a couple of similar questions here on this, but couldn't figure out how
I've found a couple of search results here but they're all for jQuery and
I have found a couple of examples on the internet to do this but
I've found a couple similar posts regarding this same problem, but none of the
I have searched SO and have found a couple of good ideas but nothing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.