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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:49:23+00:00 2026-06-03T13:49:23+00:00

I successfully setup hibernate 3.6.2 to use second level cache, using the ehcache 2.5.2

  • 0

I successfully setup hibernate 3.6.2 to use second level cache, using the ehcache 2.5.2 library.

I can see in logs and statistics that entities populate second level caches and that the queries that I want to be cacheable are cached.

As I use XML configuration in hbm.xml files, considered classes have a

<cache usage="read-write"/>

sub-element.

The following properties are defined :

hibernate.cache.use_second_level_cache=true
hibernate.cache.use_query_cache=org.hibernate.cache.EhCacheProvider
hibernate.cache.use_query_cache=true

However, hibernate does not cache the queries it generates to perform lazy loading of entities or collections. I can see them executed over and over, with the same parameters, in postgresql logs.

Is there a configuration to perform to do so ?

  • 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-03T13:49:24+00:00Added an answer on June 3, 2026 at 1:49 pm

    You just need to make sure that your classes and relatons are mapped using @Cache annotation.

    You can read more about it here:

    http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#performance-cache-mapping

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

Sidebar

Related Questions

I have successfully setup a simple mvc application that lists teams. I'm using Ninject
Using clojure, I've been able to successfully setup log4j very simply by using this
I have successfully setup castle windsor using an xml configuration file and everything works
Hi there I've successfully setup a function in JSP can calling it from the
I've successfully setup my FilteringSelect to query my server for items dynamically using the
I am using gettext for a large PHP project. I have successfully setup everything,
Simple problem - I'm using multi-db successfully with automatic routing setup as documented on
Here I have successfully create setup using visual studio 3.5. On Debug folder in
I have successfully setup the newsletter subscription for guests, so that if a guest
Running JBoss 4.2.3.GA and trying to deploy a WAR that is using Spring/Hibernate/JPA. I'm

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.