Difference between first level and second level cache in hibernate?



Difference between first level and second level cache in hibernate?..

Answer / Uma Shankar

First Level Cache (FLC) and Second Level Cache (SLC) are caching mechanisms provided by Hibernate to improve application performance:
1. First Level Cache (FLC): It is automatically created by Hibernate for every Session object. The cache stores data that was recently loaded from the database. The objects in FLC are only accessible within the same session.
2. Second Level Cache (SLC): It provides a global scope across all Sessions and is configurable via hibernate.cfg.xml or programmatically using SessionFactory. It can be implemented using EHCache, Infinispan, or any other cache provider.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

What does orm mean?

1 Answers  


Does hibernate use jdbc internally?

1 Answers  


What is the use of projection in hibernate?

1 Answers  


What are the mapping associations used in hibernate?

1 Answers  


What are the different types of caches in hibernate?

1 Answers  


What is difference between hibernate session get() and load() method?

1 Answers  


What is difference between first level cache and second level cache in hibernate?

1 Answers  


What is flushing in hibernate?

1 Answers  


What is the difference between load() and get() method in hibernate?

1 Answers  


How does hibernate update work?

1 Answers  


What orm means?

1 Answers  


How many types of cascade are there in hibernate?

1 Answers  


Categories