118 Transaction management 7.2 Transaction interface A JDO

118 Transaction management 7.2 Transaction interface A JDO persistence manager has at most one active transaction at any point in time. The PersistenceManager interface defines the currentTransaction() method, which returns an instance of the transaction interface. This transaction instance is the application developer s means for demarcating transaction boundaries within JDO. From the time a persistence manager is obtained until the time it is closed, calls to currentTransaction() will return the identical Transaction instance. Thus it is common practice, in single-threaded client-server applications that typically maintain a single persistence manager instance for an extended period, to obtain the transaction as soon as the persistence manager is available. This object is then used for transaction demarcation until the persistence manager is finally closed. During this time many independent JDO transactions may be started and completed one after the other through the single Transaction instance. Those applications that require multiple independent transactions to be active simultaneously must employ a corresponding number of persistence managers. Finally, JDO does not support the concept of nested transactions. The UML notation of the transaction interface is shown in Figure 7.1. interface Transaction +begin( ):void +commit( ):void +rollback( ):void +isActive( ):boolean +setNontransactionalRead(nontransactionalRead:boolean):void +getNontransactionalRead( ):boolean +setNontransactionalWrite(nontransactionalWrite:boolean):void +getNontransactionalWrite( ):boolean +setRetainValues(retainValues:boolean):void +getRetainValues( ):boolean +setRestoreValues(restoreValues:boolean):void +getRestoreValues( ):boolean +setOptimistic(optimistic:boolean):void +getOptimistic( ):boolean +setSynchronization(sync:Synchronization):void +getSynchronization( ):Synchronization +getPersistenceManager( ):PersistenceManager Figure 7.1 UML for Transaction interface
Note: If you are looking for good and high quality web space to host and run your java application check Vision java hosting services

Comments are closed.