Search

9.2.4. The Life cycle of a Transactional Object for Java

download PDF
A persistent object which is not in use is assumed to be in a passive state, with its state residing in an object store and activated on demand. See the Figure 9.2, “Fundamental Life cycle of a Persistent Object in TXOJ”.
Fundamental Life cycle of a Persistent Object in TXOJ

Figure 9.2. Fundamental Life cycle of a Persistent Object in TXOJ

  • The object is initially passive, and is stored in the object store as an instance of the class OutputObjectState.
  • When required by an application, the object is automatically activated by reading it from the store using a read_committed operation and is then converted from an InputObjectState instance into a fully-fledged object by the restore_state operation of the object.
  • When the application finishes with the object, it is deactivated by converting it back into an OutputObjectState instance using the save_state operation, and is then stored back into the object store as a shadow copy using the write_uncommitted method. This shadow copy can be committed, overwriting the previous version, using the commit_state operation. The existence of shadow copies is normally hidden from the programmer by the transaction system. Object de-activation normally only occurs when the top-level transaction within which the object was activated commits.

Note

During its lifetime, a persistent object may change from passive to active and back again, many times.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.