What is the best way to handle many persistence examples?
I have been downloading and playing with several persistence examples and or tracking. If I keep using the same database I then receive errors due to a missing assembly from the previous example. The way I have been handling this is by one of the methods:
1.)Wrap a try catch around the method having the issue.
2.)Create a new database for each example.
3.)Prep the database for a new example by dropping the db and running the scripts again.
I am curios for a better way. I believe I might be missing a method call to only query for the current applications instance IDs instead of all the examples I have worked with instance ids. Is that whatSqlWorkflowPersistenceService (System.Collection.Specialized.NamedValueCollection parameters) is for?
What has the community been doing?
Stan
The reason that you see this error is because there is a workflow instance record in the InstanceState table for an instance from a previous sample. When you run a new sample with the SqlWorkflowPersistenceService it will try and load all instances in the database that are ready to run. It loads the instance but it can't find the assembly for it because the assembly is in the dir for the previous sample and .Net doesn't know to look in that location for assemblies.
The fix is easy - just run the SqlPersistenceService_schema.sql file against your persistence database when running a new sample. This will drop the tables and recreate them and thus remove the old instances from the previous sample. I do this all the time while debugging.
Thanks,
Joel West
MSFTE - SDE in WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights