The Problem SolverWIndows Workflow Foundation
HomeShow ChangesEditPrintRecent ChangesSubscriptionsLost and FoundFind ReferencesRename

Search

History

28-8-2008 09:31:0111-8-2008 20:46:5929-4-2008 12:02:13

List all versions

Default Workflow Commit Work Batch Service
.
Summary
Represents the default version of WorkflowCommitWorkBatchService created by the workflow runtime engine if no other WorkflowCommitWorkBatch service is added.

The purpose of the DefaultWorkflowCommitWorkBatchService service is to enable custom logic for the commitment of work batches (also known as persistence points). When a work batch is committed, the workflow runtime calls into the DefaultWorkflowCommitWorkBatchService service and gives it a delegate to call to do the actual committing of the work batch. The runtime still has to do the commit; but it allows the service to insert itself into the process for customization around the commit process.

The only true requirement of the DefaultWorkflowCommitWorkBatchService service is to create a transaction if one does not already exist when its CommitWorkBatch method is called. If a transaction does not exist (which occurs when the Current property returns null) the DefaultWorkflowCommitWorkBatchService must create a transaction and set the ambient transaction before calling the CommitWorkBatchCallback delegate. This is done by wrapping the delegate call with a TransactionScope.

The primary reason for this service type is to enable custom error-handling logic. If the DefaultWorkflowCommitWorkBatchService service owns the transaction, because it created one when Current returns null (Nothing in Visual Basic), it can call the delegate more than once, creating a new transaction for each call. The most common example of this is to handle intermittent network problems or SQL cluster failovers. If the call to the CommitWorkBatchCallback throws an exception, WorkflowCommitWorkBatchService can catch this exception, start a new transaction, and call the delegate again. This gives a level of resilience to workflow instance execution that otherwise would cause workflows to terminate.

http://msdn2.microsoft.com/en-us/library/system.workflow.runtime.hosting.defaultworkflowcommitworkbatchservice.aspx

Wiki Usage

This wiki site is supposed to be a shared resource. As a shared resource everyone is encouraged to add new content or modify existing content!

Enjoy the WF wiki.

Recent Topics