.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Persistence not reloading workflow properly

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :WPF
To start with, some background on the project I'm working on. It's basically a todo list. I have a workflow with activities that will send a message to the UI layer to display a todo item to the user when that point in the workflow is reached. The todo activity is set up so that each time the activity context loads, it will send out a request to show the todo item if the activity is in executing status. This is a multiple host environment, so instance ownership is of interest during persistence (I use the SqlWorkflowPersistenceService). I originally was trying to set this to a max timespan. It works ok, except it relies on the closing of the application to call dispose on the workflow runtime in order to remove the ownership. If the application crashes, I have a manual "unlock workflow" functionality. That is a bit of a pain, so I thought I'd try a small ownership duration, but it's not working quite right. When I first load the workflow into the client, everything shows up fine. I have a refresh functionality that also works fine as long as the ownership duration hasn't been reached. Once it is reached, the todo item doesn't show up. I believe the workflow is not even loading from persistence. I've been testing it with a single runtime, so I know there are not any other runtimes taking ownership. Here is what I do during a refresh: for each workflow in run

View Complete Post

More Related Resource Links

Workflow persistence with a non-serializable variable

I'm using Entity Framework and WF4. I want to be able to persist a workflow but one of my variables in the workflow is an EF ObjectContext. Is there a way to make the workflow persist-able and when it re-hydrates, has a fancy new ObjectContext instance?Blades Don't Need Reloading...

workflow 4 correlation / persistence question

Hello all, I would like to understand why the following behavior takes place. In most cases my workflow that runs monthly account renewals works just fine. But with selected accounts it gets stuck. What I mean by stuck, is that a record is created in System.Activities.DurableInstancing.InstancesTable (in my persistence db), but IsInitialized remains to be set to 0 (so is IsSuspended, IsReadyToRun). When I step through my workflow, I see that the problematic accounts do not pass InitializeCorrelation activity (I pass an AccountID to initialize AccountIDHandle). What I can't figure out is  where InitializeCorrelation looks to determine if a flow with a given AccountID already runs? I killed all the instances of workflows in the database using DeleteInstance stored procedure, so InstancesTable has no rows. And yet the same problematic accounts trip over InitializeCorrelation activity - a new instance of a workflow will be created and stored in InstancesTable with IsInitialized = 0. Thank you very much, Andrei  

Windows Workflow Persistence Service using Oracle Database



We are using windows state machine workflow. We need to use Oracle for persisteing and tracking workflow instances. Can anyone provide custom services for Oracle?

We have even tried WFTools but not able to connect to Oracle database. Please provide the same code if anyone has tried.





Workflow in two sides : SQL Persistence in the WCF Service side + Workflow logic in the client side



I'm new in Windows Workflow Foundation 3.5, and I red some documentation.

Now, I would like to know if an architecture is possible in my case :

- WCF service with SQL Service access : put in it the Workflow SQL Persistence. I know that this part can be ok alone.

- Client side (ASP.Net) : put in it the Workflow logic. Ex : know when we are in a given state, and display icons and text related to this state, and know what is the next available step.

Is this architecture possible, and how to manage it in a few words ?


Workflow used with : WCF + Persistence + Tracking : how to manage ?



My question is simple : how to manage both all these technologies in the same project ?

Framework : Workflow 3.5 VS2008

What files are in the Workflow WCF Project :

- the interface for methods exposed.

- the Workflow C#.

- the app.config file.

What I already know how to do :

- Workflow WCF with SQL persistance and activate SQL Tracking

What I don't know how to do :

- Publish WCF methods in the same project for querying the tracking database (C# classes used : SqlTrackingQuery and SqlTrackingQueryOptions)

How to manage it ?

Thank you.

Workflow with id "xx" not found in state persistence store.


I have a state machine workflow having around 15 states. In few of the states I am using SqlWorkflowPersistenceService to persist the workflow instance into the database. Workflow is using WorkflowInstance.Unload() method to manually persist the workflow instance and UnloadOnIdle is set to false. Workflow service is hosted as WCF service on a windows service.

Problem: The states which implements SqlWorkflowPersistenceService to persist the wf instance calls another WCF service (which may take a lot of time) and then persists the instance. WCF service when finished with its processing responds the Workflow service by calling the operation contract associated with the Receive Activity in the next state of Workflow Service. Everything runs fine if the WCF service takes some time to respond the Workflow back. But sometimes it happens that WCF service has nothing to process and it responds immediately to the workflow, in this case workflow throws the error "Workflow with id “xxxxx” not found in state persistence store." 

What I think here is when WCF service reponds back to the WF immidiately then WF is still busy in persisting the WF instance. WF Runtime finds no wf instance in memory and checks into the persistance database. Since WF instance is still in the process o

Architectural insight for a workflow persistence/tracking problem

I'm working for a client who has many (~200) SQL databases containing client information.  My client would like to store each of their customer's workflow persistence/tracking information within their respective database.  This is needed because the databases need to be portable so they can be moved from a client site to a hosted environment and vice versa.  They want to handle all of the workflow processing from a single Windows service.  My initial thought is that I'll need to rewrite the SqlWorkflowPersistenceSerivce and SqlTrackingService services to be able to handle this requirement.  This rewrite would include the ability to scan all of the databases on a periodic basis for workflow events that need to be processed.  This sounds like a bit of challenge, and I want to make sure that I'm not overlooking something simple.

Any expert opinions on this?
Matt Ruwe

Error while executing workflow persistence


I get the following error while running my workflow, on average of about 1 in 200 instances.

An error processing the current work item has caused the workflow to abort.  See the inner exception for details. InnerException Message: The execution of the InstancePersistenceCommand named {urn:schemas-microsoft-com:System.Activities.Persistence/command}SaveWorkflow was interrupted by an error.


An error processing the current work item has caused the workflow to abort.  See the inner exception for details. InnerException Message: The operation did not complete within the allotted timeout of 00:00:00. The time allotted to this operation may have been a portion of a longer timeout.

The problem seems to be with persistence not happening within 0 seconds, but I wouldn't have a clue where i can increase this???  Remember that this workflow normally runs fine????

Jason Bolstad

Workflow - CodeActivity and Persistence



 I want to know is there any mechanism/configuration that the persisted workflow instance can resume a code activity from where the lat unloading happened?

Eg: I have a code activity which is long running code and meanwhile I will unload the instance if any service shutdown happened. Now how can i resume/restart the same code activity on loading the workflow?


Free Series of SharePoint Workflow How-to Videos

This is the series of "How to" Document Workflow with SharePoint using Visual Studio 2008 (using the .NET Framework 3.0 for backward compatibility to Visual Studio 2005). I have created video's that show the most common requests that I have seen around MOSS/SharePoint 2007 workflow & document workflow.

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

Intermittant error: "A connection attempt failed because the connected party did not properly respon



I'm having a doozy of a problem, and can't find a solution.  I have a WFC Web Service installed to a pair of servers, and accessed through a load balancer.  I am accessing the service from an ASP.NET client app, also via WCF.  The Client is not load balanced.

I'm getting an intermittant error:

(Inner Most Exception) System.Net.Sockets.SocketException:  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond x.x.x.x:80

(Middle Exception) System.Net.WebException: Unable to connect to the remote server

(Outer Exception) System.ServiceModel.EndpointNotFoundException:  Could not connect to http://<MYSite>/<MYApp>/<MYService>.svc. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond x.x.x.x:80.

I can reproduce this error with about 20% reliability if I execute the exact same page request on the client from 2 browsers at the same time.  When the problem occurs, the successful p

Workflow Services: Visual Design of Workflows with WCF and WF 4


The .NET Framework 4 makes it easier than ever to implement WCF services using WF. We'll demonstrate just how easy it is by modeling a long-running, durable and instrumented workflow based on a real-world business case without having to write any code.

Leon Welicki

MSDN Magazine May 2010

Workflow Essentials: Collaborative Workflow Improvements in SharePoint 2010


In this article, the author covers the new features in SharePoint 2010 geared for workflow developers and then walks the reader through a couple of new user scenarios.

Paul Andrew

MSDN Magazine November 2009

Foundations: Workflow Services for Local Communication


This month's column describes how to use WCF for communication between a workflow and a host application in Windows Workflow Foundation 3. This knowledge should help developers with their efforts using WF3 and prepare them for WF4, where WCF is the only abstraction over queues (referred to as "bookmarks" in WF4) that ships with the framework.

Matthew Milner

MSDN Magazine November 2009

Foundations: Windows Workflow Design Patterns


Design patterns provide a common, repeatable approach to solving software development tasks, and many different patterns can describe how to accomplish a certain goal in code. When developers begin working with Windows Workflow Foundation (WF), they often ask about how to accomplish common tasks with the technology. This month's column discusses several design patterns used in WF.

Matthew Milner

MSDN Magazine August 2009

Patterns in Practice: The Unit Of Work Pattern And Persistence Ignorance


Jeremy Miller continues his discussion of persistence patterns by reviewing the Unit of Work design pattern and examining the issues around persistence ignorance.

Jeremy Miller

MSDN Magazine June 2009

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend