Summary


Many applications require the use of transactions to protect the integrity of the data. The persistence manager has associated with it one and only one Transaction object. This Transaction object can be used to start and complete transactions in unmanaged environments. When the JDO implementation supports managed environments such as EJB containers, the JDO Transaction object is integrated with the UserTransaction in JTA and the transaction management in JCA.

The Transaction interface provides five properties to configure JDO's behavior in transactions. These properties control when transactions are needed, the type of transaction used, and the disposition of persistent state in transactional objects when the transaction ends. When necessary, the application uses the evict, refresh, and retrieve methods in the PersistenceManager interface to fine-tune when persistent state is discarded or loaded.

By using the Query, PersistenceManager, and Transaction interfaces, the application controls the explicit services of JDO. For JDO to be able to provide transparent persistence or implicit persistence services, the application data classes must be enhanced to support JDO's PersistenceCapable interface. The next chapter examines the anatomy of application data classes. It describes how to control the enhancement step through the JDO metadata and where enhancement impacts the existing functionality or design of the application data classes.




Using and Understanding Java Data Objects
Using and Understanding Java Data Objects
ISBN: 1590590430
EAN: 2147483647
Year: 2005
Pages: 156
Authors: David Ezzio

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net