• Post Reply Bookmark Topic Watch Topic
  • New Topic

first and second level cache

 
Joe McIntyre
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do these terms mean in the context of hibernate?
 
Loren Rosen
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first-level cache is associated with a session. Hibernate needs this to insure, for example, that if your query (or queries) return the same row more than once, you don't end up with multiple copies of the same object in the same Session.

The second-level cache is shared between different sessions. As usual with shared caches, consistency is an issue. The simplest use is for objects that change rarely or never.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!