此内容没有您所选择的语言版本。
9.2.4. The Life cycle of a Transactional Object for Java
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”.
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_committedoperation and is then converted from anInputObjectStateinstance into a fully-fledged object by therestore_stateoperation of the object. - When the application finishes with the object, it is deactivated by converting it back into an
OutputObjectStateinstance using thesave_stateoperation, and is then stored back into the object store as a shadow copy using thewrite_uncommittedmethod. This shadow copy can be committed, overwriting the previous version, using thecommit_stateoperation. 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.