126 Transaction management If the NontransactionalWrite flag on

Synchronization with JDO transactions 127 Improving upon RetainValues As it is currently defined, RetainValues applies globally to the entire contents of the persistence manager s cache. There is scope for this concept to be improved in future versions of JDO, so that instances of some specific persistence-capable classes can be retained but not others. Persistence-capa ble classes that represent infrequently changed reference data could then be retained in the cache, in order to reduce unnecessary data store access. A more advanced specification could facilitate timeouts for instances cached in this manner, so that the data store would indeed be checked if the instance was accessed after the designated period had elapsed. 7.6 Synchronization with JDO transactions It is sometimes useful for an application to be notified when a transaction is about to be committed or has been completed (successfully or not). The transaction interface facilitates this by providing for the registration of a user-provided callback object. The callback object must implement the javax.transaction.Synchronization interface. Its beforeCompletion() and afterCompletion() methods will be called to notify the application of these events. The synchronization interface is shown in Figure 7.2. interface javax.transaction.Synchronization +afterCompletion(:int):void +beforeCompletion( ):void Figure 7.2 UML for javax.transaction.Synchronization interface An instance of an application class that implements the Synchronization instance may be registered for transaction callbacks via the Transaction interface s setSynchronization() method. setSynchronization(javax.transaction.Synchronization sync) Replaces the previously registered synchronization object with the object sync. If the reference is null, then no object will receive transaction completion callbacks. The synchronization object s beforeCompletion() method will be invoked during the transaction s commit processing. If the method throws a
Note: If you are looking for top 10 and very good webhost to host and run your jsp application check Actions jsp hosting services

Comments are closed.