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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:08:52+00:00 2026-06-08T17:08:52+00:00

I’ve seen many posts Re: the above problem (Unable to locate persister). However the

  • 0

I’ve seen many posts Re: the above problem (Unable to locate persister). However the problem we are having is that this error occurs randomly in our web application (ASP.Net MVC). Also when we restart the app pool the problem goes away.

Mostly the error happens for an entity that is cached. See mappings below.

  <class name="Privilege" table="PRIVILEGE" lazy="false">
<cache usage="nonstrict-read-write"/>
<id name="Id" />
<property name="Description" column="DESCRIPTION" not-null="true" />
<set name="RoleCollection" table="PRIVILEGE_ROLE">
  <cache usage="nonstrict-read-write"/>
  <key column="PRIVILEGE_ID" foreign-key="PRIVILEGE_ROLE_FK1" />
  <many-to-many class="Role" column="ROLE_ID" foreign-key="PRIVILEGE_ROLE_FK2" />
</set>

<class name="Role" table="ROLE" lazy="false" >
<cache usage="nonstrict-read-write"/>
<id name="Id"  />
<property name="Description" column="DESCRIPTION" not-null="true" />
<set name="PrincipalCollection" table="ROLE_PRINCIPAL">
  <cache usage="nonstrict-read-write"/>
  <key column="ROLE_ID" foreign-key="ROLE_PRINCIPAL_FK1" />
  <many-to-many class="Principal" column="PRINCIPAL_ID" foreign-key="ROLE_PRINCIPAL_FK2" />
</set>

Could this be related to a NHb Session corruption? We’d highly appreciate if someone could at least point us in a direction of troubleshooting this as it’s not possible to consistently reproduce the problem either. (We use NHb 3.1.0.4000)

  • 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-08T17:08:54+00:00Added an answer on June 8, 2026 at 5:08 pm

    Sorry for being late to provide an update.

    I’ve figured out the reason for this and it happens to be the way the Nhibernate Session Factory was being initialized.

    1. The Nhb Session Factory was lazy initiated. i.e at the very first HTTP request requiring a DB session. (i.e Create only when it’s being actively required)
    2. Once created it’s re-used since it’s a singleton
    3. We have configured the app pool to recycle every day (4 AM) and we noticed that the first occurrence of the exception also falls roughly at the same time frame.
    4. The issue looked like a combination of IIS multi-threadeding and NHb session factory implementation, when a user (HTTP) request falls within the window of a app pool recycle.

    Solution

    1. Go back to eager initialization. i.e the initialization of the NHb session factory is now happening at Application_Start.
    2. So a HTTP-user request ‘always’ have a ready made session factor to use.

    Not only is this approach fixed the issue, I think it’s a better option from a performance point of view. Eagerly doing the costly operation of Session Factory initialization rather than putting more weight on a particular user request is more reflective of the problem at hand.

    We are running this modified version in prod for a month now without any issues.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I know there's a lot of other questions out there that deal with this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.