JDO的persistence by reachability

So what does it mean "persistence by reachability"? The JDO specification defines it the following way:
"When a persistent instance is committed to the data store, instances referenced by persistent fields of the flushed instance become persistent. This behavior propagates to all instances in the closure of instances through persistent fields. This behavior is called persistence by reachability."
And the following quote regarding makePersistent and makePersistentAll methods:
"These methods make a transient instance persistent directly. They must be called in the context of an active transaction, or a JDOUserException is thrown. They will assign an object identity to the instance and transition it to persistent-new. Any transient instances reachable from this instance via persistent fields of this instance will become provisionally persistent, transitively. That is, they behave as persistent-new instances (return true to isPersistent, isNew, and isDirty). But at commit time, the reachability algorithm is run again, and instances made provisionally persistent that are not currently reachable from persistent instances will revert to transient."

原文地址:https://www.cnblogs.com/drawwindows/p/2178459.html