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 7048067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:50:49+00:00 2026-05-28T02:50:49+00:00

I am using NH 3.2 and try to implement auto audit by creating my

  • 0

I am using NH 3.2 and try to implement auto audit by creating my own class

Public Class AuditEventListener
    Inherits DefaultSaveOrUpdateEventListener

    Protected Overrides Function PerformSave(entity As Object, id As Object, persister As IEntityPersister, _
                                             useIdentityColumn As Boolean, anything As Object, source As IEventSource, _
                                             requiresImmediateIdAccess As Boolean) As Object

        Return MyBase.PerformSave(entity, id, persister, useIdentityColumn, anything, source, requiresImmediateIdAccess)
    End Function

    Protected Overrides Function PerformSaveOrUpdate([event] As SaveOrUpdateEvent) As Object
        Return MyBase.PerformSaveOrUpdate([event])
    End Function

    Protected Overrides Sub PerformUpdate([event] As NHibernate.Event.SaveOrUpdateEvent, entity As Object, persister As NHibernate.Persister.Entity.IEntityPersister)
        MyBase.PerformUpdate([event], entity, persister)
    End Sub

    Protected Overrides Function EntityIsPersistent([event] As NHibernate.Event.SaveOrUpdateEvent) As Object
        Return MyBase.EntityIsPersistent([event])
    End Function

    Protected Overrides Function EntityIsTransient([event] As NHibernate.Event.SaveOrUpdateEvent) As Object
        Return MyBase.EntityIsTransient([event])
    End Function
End Class

And my code calls ISession.Save() then PerformSaveOrUpdate, EntityIsTransient and PerformSave are fired in sequence, which is good.

But if I call ISession.SaveOrUpdate() then nothing is fired.

Anything wrong which the code above?

  • 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. Editorial Team
    Editorial Team
    2026-05-28T02:50:50+00:00Added an answer on May 28, 2026 at 2:50 am

    I found the reason, that I made s mistake. I only registered nhConfig.EventListeners.SaveEventListeners event but forget to register nhConfig.EventListeners.SaveOrUpdateEventListeners event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DAO class which I'm using to try select/update/insert with hibernate and
Hello I'm doing some tests using reflection... so far I've got this: public class
I using JSF 2.0 + Icefaces 2.0 and try to implement spring security 2.06
Out of habit I've been using try/catch blocks in my application code for all
What kind of performance implications are there to consider when using try-catch statements in
I am writing a stored procedure where i m using try catch block. Now
Recently, I made a post about the developers I'm working with not using try
I try using evt.parent.attr(id) inside jsddm_close, but it doesn't work. <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js></script> <script
When I try using a Name=id and\or x:name=id I get a compiler error: The
I have a form that I am using to try and update a field

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.