RuntimeTransactionHandle.RequestTransactionContext Method

Definition

Initiates the creation of a NativeActivityTransactionContext for use with a new transaction.

public:
 void RequestTransactionContext(System::Activities::NativeActivityContext ^ context, Action<System::Activities::NativeActivityTransactionContext ^, System::Object ^> ^ callback, System::Object ^ state);
public void RequestTransactionContext (System.Activities.NativeActivityContext context, Action<System.Activities.NativeActivityTransactionContext,object> callback, object state);
member this.RequestTransactionContext : System.Activities.NativeActivityContext * Action<System.Activities.NativeActivityTransactionContext, obj> * obj -> unit
Public Sub RequestTransactionContext (context As NativeActivityContext, callback As Action(Of NativeActivityTransactionContext, Object), state As Object)

Parameters

context
NativeActivityContext

The current execution environment.

callback
Action<NativeActivityTransactionContext,Object>

The method to be called when the NativeActivityTransactionContext is created.

state
Object

An optional user-provided state that contains information about the request.

Remarks

This method is used when the activity creates a new transaction for use by the runtime. The workflow could potentially persist one or more times before the callback is called. This method allows transaction scopes in multiple branches of a parallel to queue up simultaneous requests without blocking each other from persisting at the completion of the transaction. To avoid errors if the workflow persists, make sure the state object can be serialized.

Applies to