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:\Windows\Microsoft.NET\Framework\v4.0.20408\SQL\en\SqlPersistenceProviderSchema40.sql
- C:\Windows\Microsoft.NET\Framework\v4.0.20408\SQL\en\SqlPersistenceProviderLogic40.sql
For WorkflowInstance usage, use these SQL scripts (note the lack of “40”):
- C:\Windows\Microsoft.NET\Framework\v4.0.20408\SQL\en\SqlPersistenceProviderSchema.sql
- C:\Windows\Microsoft.NET\Framework\v4.0.20408\SQL\en\SqlPersistenceProviderLogic.sql
Also make sure that the connection string in your application matches the database you created.
June 28th, 2009 at 3:11 am
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?
June 28th, 2009 at 2:39 pm
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.
July 4th, 2009 at 12:49 am
kenny, i have sent you an email with code, probably mail isn’arrived for wrong address..please give me your correct email address or send me a mail to nico.grilli@sparksoft.it so i can resend the question. thankyou very much
September 9th, 2009 at 7:28 am
Are you saying that you can only have persistence for either WorkflowServiceHost or WorkflowInstance in a particular database?
September 9th, 2009 at 8:02 am
You can use the same database, but in Beta1 they use different tables. This is all fixed in Beta2
September 9th, 2009 at 8:20 am
Ah, okay. Thanks for the clarification. Now to get playing…