InterviewSolution
Saved Bookmarks
| 1. |
What is the difference between first level cache and second level cache? |
||||||||
|
Answer» Hibernate has 2 cache types. First level and second level cache for which the difference is given below:
If an entity or object is loaded by CALLING the get() method then Hibernate first checked the first level cache, if it doesn’t find the object then it goes to the second level cache if CONFIGURED. If the object is not found then it finally goes to the database and returns the object, if there is no corresponding row in the table then it returns null. |
|||||||||