Setting up SQL Persistence for WF4 Beta 1

A few customers have hit a speed bump when trying to setup persistence with WF4 Beta1. We have multiple sql scripts included (for 3.5 persistence and 4.0 persistence). The problem is that depending on your WF application model in Beta1 you have to execute different scripts (we’ve fixed this in Beta2).

For WorkflowServiceHost usage, use these SQL scripts:

  • C:WindowsMicrosoft.NETFrameworkv4.0.20408SQLenSqlPersistenceProviderSchema40.sql
  • C:WindowsMicrosoft.NETFrameworkv4.0.20408SQLenSqlPersistenceProviderLogic40.sql

For WorkflowInstance usage, use these SQL scripts (note the lack of “40”):

  • C:WindowsMicrosoft.NETFrameworkv4.0.20408SQLenSqlPersistenceProviderSchema.sql
  • C:WindowsMicrosoft.NETFrameworkv4.0.20408SQLenSqlPersistenceProviderLogic.sql

Also make sure that the connection string in your application matches the database you created.

6 thoughts on “Setting up SQL Persistence for WF4 Beta 1

  1. nickwin

    Dear kenny,

    i need that inside a workflow istance i call an activity that i want load from xaml file at execution time. With WF 3.5 that was possible, now with wf 4.0 i have not found solution. Can you help me?

    when i schedule an activity i receive an exception that tell me that is necessary call a children but i can’t create a children at time of execute.

    Can you hel me?

  2. Kenny

    Correct, we don’t let you dynamically create children as part of the same workflow. That said, this restruction was in place for 3.5 as well. If you want to send me the 3.5 and 4.0 code offline, I can take a quick look. The recommended approach for such a dynamic case is to use a separate workflow, and depending on your persistence needs, you can either use WorkflowInvoker.BeginInvoke(), or a service boundary to execute the dynamic workflow.

  3. Simon

    Are you saying that you can only have persistence for either WorkflowServiceHost or WorkflowInstance in a particular database?


Leave a Reply

Your email address will not be published. Required fields are marked *