• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Persistence by reachability

 
Poobhathy Kannan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I�m newbie for hibernate
I have been going through about �Using transitive persistence in Hibernate�. Can anyone explain the bellow questions?

What is �persistence by reachability�? And what are the differences between �persistence by reachability� and �Cascading persistence�?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, they are related.

But Persistence by Reachability basically means, if I have an Object that is in the persistence context, meaning being in the first-level cache of a Session, and I call a getter method on that object and it gets say a related object that is also mapped, by default, that object retrieved is now also in the first-level cache being watched by Hibernate, so it is also placed into the persistence context.

Cascading options are related to how relations of an object are or are not saved/updated/deleted to/from the database when the Session is flushed.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic