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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:38:06+00:00 2026-05-18T08:38:06+00:00

I want to have this cached query in NHibernate: Configuration configurationEntry = session.CreateQuery(from Configuration

  • 0

I want to have this cached query in NHibernate:

Configuration configurationEntry = session.CreateQuery("from Configuration configurationEntry where configurationEntry.Name = 'DefaultVendorId'").SetCacheable(true).UniqueResult<Configuration>();

I have

<property name="cache.use_query_cache">true</property>

in the NHibernate configuration file.

However, when I run the NHibernate profiler I see that NHibernate executes the query multiple times .. I obviously want the query executed only once and the result cached. Any ideas ?

Regards,
MadSeb

  • 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-18T08:38:06+00:00Added an answer on May 18, 2026 at 8:38 am

    I hope its the same as in Java Hibernate….you have to add a linkage to your cache provider…because Hibernates provides none…

    This is part of my Java-Hibernate configuration that links cache provider.

                <prop key="hibernate.cache">true</prop>
                <prop key="hibernate.cache.use_second_level_cache">true</prop>
                <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</prop>
                <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query that gets executed though Linq to Entities. First time the
I have this method in a controller: def article_info if @article = Article.find_by_permalink(params[:permalink]) @title
I have the 4 sources of IP addresses , I want to store them
may i know as my configuration is done directly on applicationContext.xml, i do not
I want to make an AJAX call to my Java webapp. The Java webapp
I have a class in which looking up an instance is expensive, so instances
I have a SQLite database that contains a huge set of log messages. I
I'm currently working on building a library to modularize some of my code and
To keep my integration tests independent I remove all old data and insert new
I just noticed that Hibernate entities are automatically persisted to the database (or at

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.