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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:28:59+00:00 2026-06-08T18:28:59+00:00

I understand that NHibernate’s 2nd level cache works at the SessionFactory level. I’m using

  • 0

I understand that NHibernate’s 2nd level cache works at the SessionFactory level. I’m using a connection provider in my NHibernate configuration to work with my multi-tenant environment. I’m wondering how the 2nd level cache interacts with the connection provider. That is, does it intelligently maintain a cache for each separate connection string, or do all connections share the same cache?

Obviously sharing the same cache is a huge no-no since the same query will return different results based on the database it is hitting.

  • 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-08T18:29:00+00:00Added an answer on June 8, 2026 at 6:29 pm

    The life time of the second level cache is tied to the session factory and not to an individual session. Once an entity is loaded by its unique id and the second level cache is active the entity is available for all other sessions (of the same session factory).

    So 2nd level works only thru sessions of the same session factory.

    Please look First and Second Level caching in NHibernate for more details

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

Sidebar

Related Questions

It seems that NHibernate Linq doesn't understand grouped .Where method conditions. I got the
I understand that we can set the various style attributes from code behind using
I'm getting an NHibernate.DuplicateMappingException that I don't understand. The app is a simple project
I understand that nhibernate 3.1 does not support left join with the linq syntax
I understand that you should always use transactions. I also see that NHibernate.ITransaction implement
I'm using NHibernate, DI/IoC and the Unit of Work pattern. Most UoW examples I've
I understand and accept that the identity generator breaks the unit of work because
I understand that: '\n' // literally the backslash character followed by the character for
I understand that JVM and CLR were designed as stack-based virtual machines. When JIT
I understand that the em measurement is a relative unit for font-size, relative to

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.