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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:30:07+00:00 2026-05-15T22:30:07+00:00

During usage of NHibernate … One strange problem that I have bumped into was

  • 0

During usage of NHibernate …

One strange problem that I have bumped into was multiple updates after Session.Flush() command. No data actually changed … Just wanted to perform Select that all, in my case there was 1000 updates – one per returned row!!!

Such behavior happens only if I’m using properties with custom PropertyAccessor as access type. The reason that I have created custom property was that I have uint and ushort types in my objects so I wanted to cast them from (long or Int32 correspondingly )on the Setter.

The question is how can I disable those updates or why my custom Setter causing such behavior?

void Set(object target, object value)
        {
            If(Value.GetType() == typeof(long))
            {
            Target.GetType().GetProperty(_propertyName).SetValue((uint)value);
            }
        }

Thanks in advance,

Update:——
How can i disable this dirty check before every Flush?

  • 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-15T22:30:08+00:00Added an answer on May 15, 2026 at 10:30 pm

    It seems like your PropertyAccessor is messing up the NHibernate Session dirty tracking. This post shows how you can test if an entity is dirty. You should add this code and debug into the NHibernate source to see exactly why your entities are considered dirty. I suspect that the types won’t match.

    Update:

    Another approach would be to keep your Entity definitions as unsigned but change the db mappings to use signed types in the database. This is how using Fluent NHIbernate and SQL server:

    public class TestEntity : Entity
    {
        public virtual uint Unsigned { get; set; }
        public virtual ushort UnsignedShort { get; set; }
    }
    
    public class TestEntityMap : ClassMap<TestEntity>
    {
        public TestEntityMap()
        {
            Map( x => x.Unsigned ).CustomSqlType( "bigint" );
            Map( x => x.UnsignedShort ).CustomSqlType( "int" );
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Winforms application that must create write to certain configuration file during usage.
What does that mean? Getting this in the console during usage of my app
During Session Start, one has access to the Request object. How about Session End,
I'm dealing with nHibernate performance problem during hydration of a collection. The nHibernate-generated query
I have android test project that i've integrated into the Hudson. I have created
I have an app that requires me to take an action after some period
I need to collect data on firefox CPU usage during web-development coding session and
During Runtime I find that there is a very big memory usage by my
I have an condition which has to hold before and after an XMLHttpRequest usage,
During the development I experience unhandled exceptions at random occasions, but mostly after closing

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.