An instance transitions from one lifecycle state to another as the
application or JDO implementation performs various operations on it.
These state transitions occur during a transaction and at the completion
of a transaction. A transition can occur as a result of the passing of
an instance as a parameter to a method, such as
makePersistent( ). An
instance can also transition from one state to another without the
application performing any direct operations on the instance. For
example, an instance made persistent via reachability changes state
without the application directly passing the instance to a method. An
instance in the hollow or persistent-clean state will transition to
persistent-dirty if it contains a collection field and you add or remove
an element from the collection.
State Transitions During a Datastore Transaction
illustrates the state transitions that occur when you make a call to
makePersistent( ) or
or when you access a managed field. In the figure, Start State 1
represents the application calling a constructor to create an
instance, and Start State 2 occurs when the JDO implementation calls
the no-arg constructor to instantiate an instance from the
Figure 11-1. Lifecycle-state transitions
If any persistent field of a hollow instance other than a primary-key field is read, the instance transitions ...