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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:25:33+00:00 2026-05-25T02:25:33+00:00

I have a thick client application with a lot of fairly complicated object interrelationships.

  • 0

I have a thick client application with a lot of fairly complicated object interrelationships. Occassionally I have an instance where A references an entity X, which gets deleted. The database saves fine but upon reload I get the dreaded NHibernate.UnresolvableObjectException : No row with the given identifier exists[X#1].

I accept this is a bug in my software and one what I have to fix. Meanwhile, reality sets in and I need to fix the database – however how I fix it really depends what is referencing it. And I can’t find any easy way to tell.

It could be entity A, or it could be entities B-Z. I also don’t know what properties on the referencing entity could be loading it, or if it is part of a collection or what.

I’m aware you can set a Configuration.EntityNotFoundDelegate and also specify References(x => x.B).NotFound.Ignore() (or the equivalent in NHibernate). But this does not get me much closer to finding out what is referencing it. I’m normally reduced to a sometimes painstaking and exhaustive search through my database.

Perhaps with other schemas it would be easier because you could look at the foreign key constraints and reduce your search space a little. However I am using SQLite and NHibernate does not create foreign key constraints in the SQLite schema.

Ideally I am looking at logging such information. However even if I run it through the debugger very little information is obtained, as the exception is thrown deep in NHibernate code.
However even when running attempting to run it through the debugger

  • 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-25T02:25:34+00:00Added an answer on May 25, 2026 at 2:25 am

    Try using the built in SQL logging/debug logging. It should show you everything NHibernate is trying to do.

    For anyone that doesn’t know how to do this, you need to define the log4net config section in your .config file

        <configSections>
            <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
        </configSections>
    

    Then, add the actual log4net config section. Set up an appender and a logger. In this example, NHibernate’s SQL will be appended to C:\projects\logs\NHibernate.log. In my case, this is a windows service and it has access to that directory. You will want to ensure that the path you set is accessible by your application. You also need to set “ShowSQL” to true when you configure your session factory.

    Log4Net Config Section:

        <log4net>
    
            <appender name="NHibernateAppender" type="log4net.Appender.RollingFileAppender">
                <file value="C:\Projects\logs\NHibernate.log" />
                <appendToFile value="true" />
                <maximumFileSize value="1000KB" />
                <maxSizeRollBackups value="2" />
                <layout type="log4net.Layout.PatternLayout">
                    <conversionPattern value="%date %level %thread %logger - %message%newline" />
                </layout>
            </appender>
    
            <logger name="NHibernate.SQL" additivity="true">
                <level value="ERROR" />
                <appender-ref ref="NHibernateAppender" />
            </logger>
        </log4net>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a hibernate object that gets detached and transferred to a thick java
I have recently joined a new developing project building a thick client application using
We have a WCF (Windows Communication Foundation) client and service application. We're using Windows
We have a typical business application with an Outlook-looking Winforms client talking to asmx
I have to create a mobile application which will work on diffrent mobile platforms:
I am in the process of designing a web application which will have multiple
We have an application which acts as a touchscreen overlay. It provides custom touchscreen
Let's say I have my client application and it makes a connection to the
I have an client application that connects to the DB via the using clause.
I am developing one wcf client application. here i have 7 different requests. is

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.