As you have seen earlier, the JDO runtime contains an instance
cache managed by the
PersistenceManager, and in the transaction
modes we have presented thus far, instances in the cache have always
been transactional. We now introduce the behavior of the cache and the
instances contained in the cache in light of nontransactional behavior.
There are five independent flags that govern this behavior.
This flag enables your application to iterate extents, perform queries, access persistent values of persistent instances, and navigate the entire graph of persistent instances, without having a transaction active.
This flag enables your application to make changes to the
cache that will never be committed to the datastore. Most
applications expect that changes made to persistent instances will
be stored in the datastore at some point.
NontransactionalWrite caters to
applications that manage a cache of persistent instances where the
changes to the datastore are made by a different
This flag enables your application to execute transactions
that improve the concurrency of datastore access, by deferring
locking of data until commit. We discuss optimistic transactions
in detail in Chapter 15;
we introduce it here because instances used in an optimistic
transaction are read nontransactionally, so they share common
characteristics of data that is read with
This flag enables your ...