Hibernate Caching Mechanism, Hibernate Cache

Hibernate » on Aug 10, 2011 { 11 Comments } By Sivateja

Every fresh session having its own cache memory, Caching is a mechanism for storing the loaded objects into a cache memory.  The advantage of cache mechanism is, whenever again we want to load the same object from the database then instead of hitting the database once again, it loads from the local cache memory only, so that the no. of round trips between an application and a database server got decreased.  It means caching mechanism increases the performance of the application.

In hibernate we have two levels of caching

  • First Level Cache [ or ] Session Cache
  • Second Level Cache [ or ] Session Factory Cache [ or  ] JVM Level Cache

Let us see one by one session cache concepts in depth.


You Might Also Like

  ::. About the Author .::

Sivateja Kandula - Java/J2EE Full Stack Developer
Founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog, Love Java and UI frameworks.
You can sign-up for the Email Newsletter for your daily dose of Java tutorials.


11 Responses to “Hibernate Caching Mechanism, Hibernate Cache”
  1. Sheryl Kanosh says:

    I was looking through some of your articles on this website and I conceive this website is really informative! Keep on posting.

  2. Arvind says:

    This is the best website for HIBERNATE point of view…so far I haven’t met this kind of such a easy tutorial…thanks for sharing…doing great job:))

  3. Java4s says:

    @Arvind, @Sheryl

    You bet, Thanks much.

  4. naresh says:

    Hi This Is Good site for java learners…………
    greate tutorial………………..
    thanq u for posting …………

  5. Thanks Buddy , really nice job. This tutorial is something different and best one covers the things which are required to explain to beginners . Keep it up.

  6. Sudha says:


    nice job ,thanks for ur effort in this,i got so much knowledge in Hibernate through this blog. ThanX……

  7. Arshi says:


    Please explain me how to refresh second level cache if DB is altered manually by some one, while application has loaded it in session, how to get the refreshed object? please help

  8. GAuri says:

    Such a HELPFULL website ….:) thank you very much for explaining each frameworks related to JAVA in such easiest Manner……:)GOOD JOB.and ha please do post article related to JSP.

  9. mallika sherawat says:

    Good website for beginner and experienced persons.

  10. Hemanth says:

    Such a simplest way u have explained …! Easy to understand things quickly. Thank you!


By posting your answer, you agree to our comments policy.
Most Recent Posts from Top Categories
Spring Boot Hibernate Spring
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2024 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.