A.1. How the Tables Should Be Read

Take a look at the first field in the first column (transient) and first row (makePersistent). This field means that if PersistenceManager.makePersistent is called with an instance, which state is transient, the resulting state is persistent-new. To keep the table short, not all operations are explicitly listed. For instance, PersistenceManager.makePersistentAll(Collection c) and PersistenceManager.makePersistentAll(Object[] o) have the same effect on instances contained in the collection or array, just as makePersistent()has on a single instance. The same is true for deletePersistent, makeTransient, makeTransactional, and makeNontransactional, respectively.

If a field is marked “Error!”, the corresponding operation on an instance is not allowed and causes a JDOUserException to be thrown. The state will not change.

If a field is marked “Impossible”, the operation cannot be performed on an instance because the initial state is not reachable. For instance, there are no instances that have the state persistent-new outside of active transactions, so “read fields outside of active transactions” cannot be performed.

If a “–” (dash) appears in a field, the state does not change.

Table A-1. State Transitions
Current StateTransientPersistent-newPersistent-cleanPersistent-dirtyHollow
Method     
makePersistentpersistent-new
deletePersistenterror!persistent-new-deletedpersistent-deleted
makeTransactionaltransient-clean
makeNonTransactionalerror!persistent-nontrans.error!
makeTransienterror!transienterror!transient
commitHollow
commit (retain values)persistent-nontrans.
rollbacktransientHollow
rollback (retain values)transientpersistent-nontrans.
refresh (active)persistent-clean
refresh (optimistic)persistent-nontrans.
evictn/ahollow
read field (outside)impossiblepersistent-nontrans.
read field (optimistic)persistentpnontrans.
read field (active)persistent-clean
write field (outside)impossiblepersistent-nontrans.
write field (active)persistent-dirtypersistent-dirty
retrieve (outside or optimistic)persistent-nontrans.
retrieve (active)persistent-clean

Table A-2. State Transitions
Current StateTransient-cleanTransient-dirtyPersistent-new-deletedPersistent-deletedPersistent-nontrans.
Method     
makePersistentpersistent-new
deletePersistenterror!persistent-deleted
makeTransactionalpersistent-clean
makeNonTransactionalTransienterror!
makeTransienterror!transient
committransient-cleantransient
commit (retain values)transient-cleantransient
rollbacktransient-cleantransienthollow
rollback (retain values)transient-cleantransientpersistent-nontrans.
refresh (active)
refresh (optimistic)
evicthollow
read field (outside)impossible
read field (optimistic)error!
read field (active)error!persistent-clean
write field (outside)impossible
write field (active)transient-dirtyerror!persistent-dirty
retrieve (outside or optimistic)
retrieve (active)persistent-clean

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset