Nontransactional Features
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.
NontransactionalReadThis 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.
NontransactionalWriteThis 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.
NontransactionalWritecaters to applications that manage a cache of persistent instances where the changes to the datastore are made by a different application.OptimisticThis 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
NontransactionalRead.RetainValuesThis flag enables your ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access