• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate and second level cache

joe black
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am using a second level cache such as EHCache, and I have a class defined as read write, if I load a class by id from the cache, and then do an update, will hibernate get the latest from the DB, and then update the DB as well as the cache? Lets assume this class has no associations.

And if I have another class which is declared as read only, calling save on an instance will add it to the db as well as add it to the cache, to be retrieved later by a load from the cache? What if I do an update on a read only instance?
[ September 27, 2006: Message edited by: joe black ]
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!