• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate :Collections can also be cached

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

What is the use specifying this way : <cache usage="read-only"/>


A hbm file is consisting similar to like this :



As you all know this is the child object associated with the Parent (Primary Key and Foreign Key)


<cache usage="read-only"/>

what i think is any modifications made to the child table when loaded with a Parent table will not be affected ??
Am i right ? Waiting for your responses.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RaviNada Kiran wrote:
what i think is any modifications made to the child table when loaded with a Parent table will not be affected ??



Any updates made to the child within this parent will be persisted/reflected in the DB, but the cache corresponding to this parent-child relationship will not be updated (i.e. it will be stale) since its marked read-only.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Great Explanation Jai Kiran .

Thanks a lot .I mean it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic