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

Post New Web Links

Persistence and SendActivity

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :WPF

Dear all,

I have a WF with a non initiating Receive Activity. When a different WF executes the SendActivity linked to the ReceiveAct, I get the following error:

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

This happens only when I have the Persistence server configured with UnloadOnIdle = false, but if I set this parameter to True, the SendActivity is processed correctly. I have checked on the Persistence DB and prior to the SendActivity my WF did not finish with any kind of error.

My question is the following:

If my WF is not in the Persistence Store, I guess it is still loaded in memory so, how is it possible that the SendActivity fails? Shouldn't the workflow runtime look for the WF Guid in memory before going to the Persistence Store?

Any ideas?

Many thanks in advance.

View Complete Post

More Related Resource Links

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

Patterns in Practice: Persistence Patterns


Here we examine data persistence patterns to help you determine which best suits your needs. We look at a number of patterns, including the Active Record, the Data Mapper, the Repository, the Identity Map, the Lazy Loading, and the Virtual Proxy.

Jeremy Miller

MSDN Magazine April 2009

How to config a SendActivity make it consumes a WCF service?

In a ASP.net web project, I have a WCF service and Workflow service and my workflow service want to use the wcf service, so I use the SendActivity to consume the WCF service. I do this in the follow step: 1.Using Add the service reference dialog add the WCF service reference to my project 2.Add a SendActivity to the workflow and config it like this: EndpointConfigurationName:BasicHttpBinding_ISimpleService ServiceContractName:SimpleServices.ISimpleService OperationName:DoWork and set correct parameters.   All this config value I am copyed from the config file. But when I run this project it's always throw exception says "ContractFilter mismatch at the EndpointDispatcher" . But if I directly call the WCF service in code, it's all ok. For demo, I create a very simply WCF service and Workflow service for testing how to config, so I paste all the code here: namespace WFCallService.Services { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "ISimpleService" in both code and config file together. [ServiceContract] public interface ISimpleService { [OperationContract] void DoWork(string workName); } } namespace WFCallService.Services { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Sim

Persistence not reloading workflow properly

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

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...

SQL Persistence Service

I'm facing a situation with WWF where I keep loosing workflow instances (I get the error workflow not found in state persistence store). I'm quite sure that every activity within the workflow has the faulthandler correctly configured and the SqlWorkflowPersistenceService is also properly installed and configured. This never happened on my previous server but since I moved this to a new server sometimes it occurs. Given this, I have 2 questions: Is there any way to recover the persistency of a workflow? Is there a way to guarantee this doesn't happens again? Meanwhile I've configured the EnableRetries to true hopping that this will prevent further losses. I suspect that sometimes the sql server is not running or inaccessible. Thank you so much for your time.Bu

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 - Does "SendActivity" get batched along with SharePoint Activites?


Hi, I am looking at simultaneously making WCF calls and updating SharePoint list data in a Workflow.

I know that the OOB workflow activites (create task / create list item / check in document) will "batch", in that the transactions do not get submitted to the database until a workflow commit point is hit. This is great because it means we have secure "rollback" handling, if one of the operations fails then NONE of them are committed.

My main problem is how to hook these up with WCF calls. I know that there is an activity in WF 3.5 (SendActivity / ReceiveActivity) which relate directly to WCF calls, but do these batch in a single transaction, alongside the SharePoint activities?

If the answer is no, then I am facing the problem that my WCF service is going to get called whether the next commit point is reached or not!


Martin Hatch
MCPD .Net Web Development
MCTS WSS 3.0 | MOSS 2007
Visit my Blog - www.martinhatch.com

StopRuntime method and lock on instance on persistence store- How are they related



Does call to StopRuntime method on the Workflow Runtime also releases the lock hold on an instance in persistence store by this runtime.

or the instance is locked for complete duration instanceOwnershipDuration.



Linq to Entities Many to Many Persistence Issue


I am having problems persisting a many to many. My code saves the Problem but not the users that can be attached to a problem. My Linq to Entities Mapping is below in the first three code blocks. I then have my ASP MVC controller method which receives a problem, a file (optional), and a string array of users which are allowed to view the problem. I retrieve the Users from the UserRepository and add them to a List which is then passed through to the ProblemRespository with the problem and added to the problem.Users collection. However when submitted only the problem is being saved and not the records which are required in the junction table. Any help would be appreciated. This is the first time I've attempted my own mapping.
Thanks in advance.

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.

System.Runtime.Persistence.InstanceOwnerException causing WorkflowServiceHost Instability

I have a Windows Service running about 7 workflow service hosts, which are obviously hosting Workflow Services.  90% of the time they work fine, but randomly the services seem to fault.  I've had to put a bunch of code in the Windows Service to automatically handle fauled services by aborting them and restarting them.  As well as I've had to make a wrapper around my WCF client to automatically retry hitting the workflow services to account for if they are faulted.  I'm handling the faults / restarting the services in the WorkflowServiceHost.Faulted event.  One of the problems I've had is that the Faulted event has no details about what caused the fault.  No exceptions or anything.  Many times workflows fault due to bugs in the actual workflow design, and those exceptions are captured by workflow tracking.  However, randomly in my logs, there will be service faults with no additional exception data.  Today I hit that in the debugger for the first time, and I was able to figure out that there indeed is an exception somewhere in the object, but it's a private property!  This is the exception I'm getting:

    [System.Runtime.Persistence.InstanceOwnerException]: {"The execution of an InstancePersistenceCommand was interrupted because the instance own

Master Pages and object persistence


Hi. I'm new to MVC2. I  build a menu, based on jquery and xml. 

My ideia was to have this menu on mvc master page, and the submenus had action links to several other views, who would show up in one or several asp ContentPlaceHolder.

On another post, ignatandrei, show me this: http://msprogrammer.serviciipeweb.ro/2010/07/19/asp-net-mvc-pass-data-from-a-view-to-master/, which i was really nice but don't solve my problem. which is that when i click on any element of menu, i'll get erro because any call to my menu object is made to an null object. 

How can i make objects became persistent in my master page, regardeless the views i want to show up in content holders, because after i click on menu subitem (html.action) they made the previous menu object became null?

I tried using partial views, adapt the upcode example to my situation, and several others ideias - none has resulted. 

When i readapt the code on upper link, i got issues regarding objects types that didn't match - which is something that i think is related to what page inherits?

Resumed, is it possible to have a similar behavior to asp.net no mvc regarding master pages? 

Persistence / Loading from SQL store



I'm trying to do something that I'm considering quite simple but it does not seems to work.

Basically, I need to start workflows, persist them right away and pick up it from another machine (host).


class DemoActivity :

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