org.omg.CosTransactions

Interface SubtransactionAwareResourceOperations

public interface SubtransactionAwareResourceOperations extends ResourceOperations

Recoverable objects that implement nested transaction behavior may support a specialization of the Resource interface called the SubtransactionAwareResource interface. A recoverable object can be notified of the completion of a subtransaction by registering a specialized resource object that offers the SubtransactionAwareResource interface with the Transaction Service. This registration is done by using the register_resource or the register_subtran_aware operation of the current Coordinator object. A recoverable object generally uses the register_resource operation to register a resource that will participate in the completion of the top-level transaction and the register_subtran_aware operation to be notified of the completion of a subtransaction. Certain recoverable objects may want a finer control over the registration in the completion of a subtransaction. These recoverable objects will use the register_resource operation to ensure participation in the completion of the top-level transaction and they will use the register_subtran_aware operation to be notified of the completion of a particular subtransaction. For example, a recoverable object can use the register_subtran_aware operation to establish a "committed with respect to" relationship between transactions; that is, the recoverable object wants to be informed when a particular subtransaction is committed and then perform certain operations on the transactions that depend on that transactions completion. This technique could be used to implement lock inheritance, for example. The Transaction Service uses the SubtransactionAwareResource interface on each Resource object registered with a subtransaction. Each object supporting this interface is implicitly associated with a single subtransaction.
Method Summary
voidcommit_subtransaction(Coordinator parent)
This operation is invoked only if the resource has been registered with a subtransaction and the subtransaction has been committed.
voidrollback_subtransaction()
This operation is invoked only if the resource has been registered with a subtransaction and notifies the resource that the subtransaction has rolled back.

Method Detail

commit_subtransaction

public void commit_subtransaction(Coordinator parent)
This operation is invoked only if the resource has been registered with a subtransaction and the subtransaction has been committed. The Resource object is provided with a Coordinator that represents the parent transaction. This operation may raise a standard exception such as TRANSACTION_ROLLEDBACK. Note that the results of a committed subtransaction are relative to the completion of its ancestor transactions, that is, these results can be undone if any ancestor transaction is rolled back.

rollback_subtransaction

public void rollback_subtransaction()
This operation is invoked only if the resource has been registered with a subtransaction and notifies the resource that the subtransaction has rolled back.