So what is the difference. Suppose your workflow doest some stuff, is unloaded into the persistence store, continues executing, starts an TransactionScopeActivity, doest some work, terminates the TransactionScopeActivity and then before the workflow is finished or persisted again has the runtime crash on it.
Now the transaction has completed and is committed but the state of the workflow is still as it was last persisted, ie before the TransactionScopeActivity was executed. Suppose the runtime is restarted, it will detect and reload the workflow and continue from the unloaded point so do the TransactionScopeActivity again.
Now if you use a WorkBatch to commit the data things work a little different. The WorkBatch is committed in a TransactionScope but this will include the WorkflowPersistenceService itself. So if the workflow runtime crashes before the batch is committed no work is saved at all and everything can safely be repeated. If on the other hand the batch is saved and the workflow runtime crashes after that the workflow will be restarted from the second time it was saved and not repeat the work done.
A WorkBatch uses the IPendingWork interface to allow a service to commit work items.
add a one or paragraph summary or description of what's discussed here; put yours after 'Summary:'
23-11-2009 15:31:55 - -80.126.16.139
Wraps all contained activities in a TransactionScope
23-11-2009 15:31:00 - -80.126.16.139
Wraps all contained activities in a TransactionScope
23-11-2009 15:31:00 - -80.126.16.139
Wraps all contained activities in a TransactionScope
23-11-2009 15:31:00 - -80.126.16.139
add a one or paragraph summary or description of what's discussed here; put yours after 'Summary:'