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

  • Home
  • SEARCH
  • 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 8696959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:23:47+00:00 2026-06-13T01:23:47+00:00

What would cause a change to not generate an update statement for an existing

  • 0

What would cause a change to not generate an update statement for an existing entity? I have a command that updates a status enum on an entity. It changes it from Active to Deleted. I use the same command (generically) to update the status bit on other entities without a problem. I can update a single string on the entity in question without changing anything else and the update processes fine. I can observe all this going down in NHProf…

I guess my questions then are:

  • What would cause NHibernate to not update an entity when an enum value (and nothing else … or other things to?) is/are changed?
  • What is the best way to track down issues like these?

Thanks for your help!

A clue. The property on the base type is:

public virtual EntityStatus Status { get; protected set; }

If I make the setter public and assign to it directly, NHibernate picks it up just fine. When it’s protected, I call a method on the entity and update the Status there. Does that provide any clues?

  • 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-06-13T01:23:49+00:00Added an answer on June 13, 2026 at 1:23 am

    So, this was a fun one and a total pain in the ass to track down. It turns out that using Lazy loading inside of an Any mapping somehow screws the ol’ pooch somewhere. So calling a virtual method to update a protected property does not work when I do this:

    Any(o => o.Thing, typeof(Guid), m =>
                            {
                                m.IdType<Guid>();
                                m.MetaType<string>();
                                m.MetaValue("Squirmy", typeof(SquirmyThing));
                                m.MetaValue("Odoriferous", typeof(OdoriferousThing));
                                m.Columns(id => id.Name("ThingId"), cr => cr.Name("ThingType"));
                                m.Lazy(true);
                                m.Cascade(Cascade.Persist);
                            });
    

    But it DOES work when I do this:

    Any(o => o.Thing, typeof(Guid), m =>
                            {
                                m.IdType<Guid>();
                                m.MetaType<string>();
                                m.MetaValue("Squirmy", typeof(SquirmyThing));
                                m.MetaValue("Odoriferous", typeof(OdoriferousThing));
                                m.Columns(id => id.Name("ThingId"), cr => cr.Name("ThingType"));
                                m.Lazy(false);
                                m.Cascade(Cascade.Persist);
                            });
    

    Anyway, I really hope this helps someone else crazy enough to use an Any mapping.

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

Sidebar

Related Questions

So I am wondering what would cause it so that all events for the
We have a business case that would be perfect for multiple BackgroundWorkers. As an
I wanted to generate a hardware hash that would be used to generate a
I have a long-running process written in Python 2.7 that I would like to
Is there any reason why printw() would cause a segmentation fault? Code is fine
Why/how does this create a seemingly infinite loop? Incorrectly, I assumed this would cause
What would possibly cause a 'git push' to try and commit to two branches?
Would the code bellow cause my code to leak? More specifically, am I responsible
I really would like to get a scrollbar for the page cause atm the
Does dependency injection potentially cause large overhead? I would imagine so, especially if the

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.