ObjectDB ObjectDB

setSynchronization(sync) - JDO Transaction's method

Method
javax.jdo.Transaction
void setSynchronization(
  Synchronization sync
)

The user can specify a Synchronization instance to be notified on transaction completions. The beforeCompletion method is called prior to flushing instances to the data store.

The afterCompletion method is called after performing state transitions of persistent and transactional instances, following the data store commit or rollback operation.

Only one Synchronization instance can be registered with the Transaction. If the application requires more than one instance to receive synchronization callbacks, then the single application instance is responsible for managing them, and forwarding callbacks to them.

Parameters:
sync - the Synchronization instance to be notified; null for none
Since:
JDO 1.0