Workflow Foundation 4.0 - Transaction service & SQL Tracking service?
I am exploring if Workflow Foundation 4.0 is stable e开发者_如何学Gonough to start developing on it but the documentations I've seen so far are mysteriously silent about why there are no built-in Transaction & SQL Tracking services! They were available in WF 3.5 and seemed to be reasonably stable. Any clues? Was there no time for MS to release WF 4.0 on schedule or the whole concept was broken in 3.5 that they decided to scrap them? I know there are lot of links and hints pointing to writing a custom (SQL) tracking participant, but then what is the point of a "framework"? Moreover there's no way to query the tracked data. And nothing about Transaction service! So how do we keep the WF persistence data & application data consistent? Am i missing something here?
Some unsatisfactory answers on "missing" SQL tracking in WF4:
- http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/8cfe598a-a400-4804-92ad-d68aa444d8f3 [got a few more links, but couldn't post them here bcoz new users can post only one hyperlink per question :( ]Any help will be greatly appreciated :)
SQL tracking is missing however the AppFabric does include tracking if you go the workflow services route.
Transactions are supported. There is the TransactionScope activity for short running transactions an a CompensatableTransaction for doing long running transactions. There is also the option of creating activity extensions based upon PersistenceIOParticipant where you can save extra data durin THE transaction used to save THE workflow.
According to MSDN, the SQLTrackingService is still supported (see the bottom of the below article):
http://msdn.microsoft.com/en-us/library/system.workflow.runtime.tracking.sqltrackingservice.aspx
You will have to add references to System.Workflow.Runtime.dll (and probably System.Workflow.ComponentModel.dll) to your project. Make sure you are targeting the full .net 4 framework in your project properties (i.e. not the client .net 4 framework). Both dlls can be found in the v4 framework directory.
精彩评论