This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cache usage = "read-only "  RSS feed

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If a Collection is marked to cache usage = "read-only " on to the hbm files .

And if this Collection is updated will the Hibernate Framework throw any Exception . Please tell me .

Simply the Question is :

what happens if one set cache usage = "read-only " and do an update on the Entity ?


 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody please.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried using it?
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works fin

It works but whenever an Entity is modified in Database the cache will be not updated .


I just want to confirm so posted here
 
Kadle Rajesh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think any exception will be thrown.

But as we are declaring the cache read-only, the object in cache will NEVER be invalidated.

Welcome other views....
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


invalidated or not invalidated depends on the parameter you used in the second level cache ( say maxtimetolive in ehcache.xml incase of EHCache ).

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!