.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

Unloading persisted states causes workflow problems

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


We are using WF 3.5 with a SqlWorkflowPersistenceService with the ownershipduration set at 2 hours and the loadingInternval at 1 hour.  We are finding that on certain occasions, rehydrated or attempts to rehydryate a persisted state results in some unusual behaviour. Of particular note, has been two of the same instance running and subsquently one fails (e.g. the first one removes data from a server, the second one attempts the same op -to remove the same data and subsquently fails becasue it was already removed by the first). In some cases, it almost resembes race conditions of two of the same instances!  Trying to replicate or reproduce the issue can be diffucult, but the closest I can get appears to be shortening the ownership interval in a running workflow instance resulting in

System.Workflow.Runtime.Hosting.PersistenceException: This workflow is not owned by the WorkflowRuntime. The WorkflowRuntime's ownership has expired, or another WorkflowRuntime owns the workflow.

but Im not sure if this is the problem.  Does this sound like an ownership issue with a particular workflow runtime? If so, I fail to see how two instances could run at once (I would have thought WD/Sql persistence server would prevent this from occurring)?

Any help would be greatly appreciated,




View Complete Post

More Related Resource Links

Problems with "Set Field in Current Item" in SP 2007 Workflow

I have created a workflow in spd 2007 that begins by comparing two lists and if the “VendorName” is the same on both lists, I then auto-populating four fields by grabbing the values from another list within same site collection by using the “Set Field in Current Item” action. I have recently discovered that I cannot set additional fields beyond these four fields. I have tried this on two different sites using the same action (i.e. set field in current item) and the result is the same – I cannot add additional actions of this type? To remedy this, I removed duplicate instances of the workflow via List Settings > Workflow Settings > remove dups, but no luck. Problems still persists.   What would be causing this? Has anyone run across this issue? Help!   Thank you in advance.

writing workflow with two states approvement

Hi, I am writting workflow with 2 states for approve ,that i write the event handler that is calling workflow and when calling workflow person1 must approve this change and if he/she approve this,person 2 must approve this change and where this changed was reject, send email to changer...what i doing this work?in visual studio 2010 , what defining  the work flow with states for approve? Thanks.  

Problems when deploying sequential workflow with association Infopath form of sharepoint 2010 using


I’ve create a workflow project with infopath in it. And I get the error

 “Error occurred in deployment step 'Activate Features': Unable to locate the workflow's association data. To restore the association data to the workflow, restart the workflow settings wizard by selecting the workflow node in Solution Explorer and then clicking the ellipsis button (…) on one of the properties in the Properties window that has an ellipsis button.”

I'd really appreciate of any help.

Workflow States is DISABLED.. please help!!!!



Okay I just installed WSS 3.0. This is OUT OF THE BOX, and I didn't do much configuration to it. I need to utilize workflow in my company. So I created a DOCUMENT LIST, and went into DOCUMENT SETTINGS > WORKFLOW SETTINGS.

Afterwards, I select the THREE STATE WORKFLOW and typed the name of the workflow and clicked on NEXT.

I cannot go past the 2nd page! On the top, there is a section for WORKFLOW STATES. There are DROP DOWN menus for this:

Choice field
Initial State
Middle State
Final State

All FOUR of these DROP DOWN menus are disabled. I cannot select anything. What is going on? Why am I not seeing a selection with the drop down menu?

Please help.. I cannot find ANYTHING anywhere about this. If you installed WSS 3.0 and the WORKFLOW STATES are ENABLED for you out of the box, please let me know.

It must be something so simple Im overlooking.

thanks in advance.


How To Reload a Persisted Workflow with WorkflowServiceHost


We are using Workflow Foundation 4 Beta 2 with a client / server architecture where the client runs workflow through the server  using a WorkflowServiceHost. The client itself runs no workflow. The workflow is long running, requiring that it persist while awaiting user input. We have set up correlation and persistence such that the user can successfully move the workflow from one activity to another. The problem occurs when the workflow is unloaded or the server application is restarted; we are unable to determine how to continue a workflow that has been unloaded. We have looked at numerous samples such as the Hiring Request Process (http://msdn.microsoft.com/en-us/library/ee622985(VS.100).aspx) and the samples demonstrate the same issue…everything works great until the workflows are unloaded or the server (application running the workflowservicehost) is restarted. There is no exception thrown by the client call, the workflow simply doesn’t move forward.

Loading persisted workflow instances with WorkflowApplication


I understand I may be doing this wrong.  I read the topic at http://social.msdn.microsoft.com/Forums/en-CA/wfprerelease/thread/a11eb75d-65de-4787-9745-2fd634d0eee9 but I still don't get it, exactly.

I have an application that uses WorkflowApplications to handle the workflows.  I have a workflow that contains a one minute Delay activity.  When this activity is hit, the workflow Idles, persists (SqlWorkflowDataStore), and unloads.  This is all fine.  If the app runs for the minute, it will be resumed and will complete.

However, if I stop the app during the minute that it is delayed, and then start it up again at some point later, the workflows do not resume.  A little digging shows that WorkflowApplication does not resume automatically, and that I have to do that manually.  That's fine.  The problem is, I don't know how.

I see there is a WorkflowApplication.LoadRunnableInstance, and I see in the db that there are records in the RunnableInstancesTable table.  But when I call LRI, I get back this:

System.Runtime.DurableInstancing.InstancePersistenceCommandException was unhandled
  Message=In order to match and load a runnable instance in the store, the requesting InstanceOwner must have specified a workflow host type when it was created. To do so, add a key-value pair to the CreateWorkflowOwner

SharePoint Workflow and Permission Problems - User cannot edit assigned task

I've seen numerous posts on here talking about the same problem we're having, but the solutions listed in those do not work for us. So I apologize for reposting this subject, but we're getting desperate.

We have a custom workflow that is assigning a task to a user, then that user is clicking "edit the task" and getting access denied.  We've broken permission inheritance on the document library where the workflow is kicked off, the task list, and the workflow list (accessing through permissions in SPD) and given the user having the issue full control of these lists and libraries. This results in the user still getting access denied. When we add the user to the Owners Group of this particular site, the user can edit the task with no error message. This isnt' a solution of course as we cannot have the user in the owner's group.

We have custom workflows on several of our SharePoint sites and have never had this problem before. We've now spent a combined total of 6 hours on the phone with Microsoft Support and no one can tell us what the problem is. Help!

Top .NET Performance Problems and how to avoid them

Every time I work with one of our .NET customers to help them with managing their application performance I come across the same problems as seen with other clients before: lots of ADO.NET queries, many hidden exceptions in core or 3rd party .NET libraries, slow 3rd party components, inefficient custom code

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.

Visual Studio 2008 Memory problems


My memory in task manager reaches about 900,000K  and I don't know why it does this. Definately slows everything down, especially when I rebuild my tableAdapters, takes about 30 seconds sometimes to rebuild the project.

Problems with Forms Authentication in DD 4 site


Hello,  I am seeing a strange problem with Forms Authentication in my DD site.   A user logs into and can view/edit/delete data all day, but when they execute a Custom Filter against data (for example , a control DynamicData/Filters/CustomerLastNameSearch.ascx ) then the site auth fails, and redirects to the log in screen.

in web.config I have

     <authentication mode="Forms">
            <forms name=".Star" loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Default.aspx" path="/" timeout="43200" cookieless="UseCookies" />     

Offhand, I am thinking two things : that DynamicData/Filters path requires some special handling for some reason, or the control extension ascx is causing auth to get confused.   Has anyone else experienced this or have any suggestions?  Thanks!

Problems posting to a package


Hey Y'all

I'm currently creating a program that accesses a mysql package to add data to a few tables.  I'm currently getting an error that says  "

ORA-01403: no data found
ORA-06512: at "JESSE.PKG_WORKPLAN", line 42
ORA-06512: at "JESSE.PKG_WORKPLAN", line 177
ORA-06512: at line 1


These lines are


and 177:add_team_members(V_PROJECT_ID, V_START_DATE, v_FISC_YEAR, V_MEMBERS ,V_NUM_MEMBERS,'add');

Checking these variables in my asp.net page they are all receiving parameters.

Is there a  way to see what the database is actually receiving from the asp.net page?

Or is there another thing to be looking at?


URL Routing and Existing HttpHandler problems


Hello everyone,

I have a problem:

I am currently using 2 features: 

1. HttpHandler

Registering the path="res.aspx" verb="*"

2. URL Routing:

Registering with this pattern: "Company/Edit/{*companyId}","~/CompanyEdit.aspx"

In my CompanyEdit.aspx page, I used httphandler res.aspx to generate some images at client.

  • res.aspx?img=1
  • res.aspx?img=3

Now the problem is here, the page is load success with companyId = "12345", but when the images was loaded at client, it loaded the CompanyEdit.aspx again and show error with wrong id.  

I have debug and find the problem that because when image's urls were generated to client with url=res.aspx?img=1, url=res.aspx?img=3, the asp.net will understand that they are Company/Edit/res.aspx?img=1, Company/Edit/res.aspx?img=3 when it maps with URL Routing pattern.

=> So the CompanyEdit.aspx was load again with wrong id (id now is "res.aspx"). 

So, do you have any ideas to solve this problem, or other design.

Thanks, and best regard

ASP.NET 4 precompilation problems



We used ASP.NET precompilation (first manually, then with VS2008 WDP) with .NET 3.5 almost (see below) successfully.

After we moved to 4.0, the precompilation no longer works properly. The precompilation process itself succeeds, and the website works, but it consumes about twice the CPU it does without any precompilation. We use non-updatable precompilation (so webpages get compiled completely).

Our internal profiling tells us that most of the threads spend their time within variations of the following stack:


  System.Web.dll!System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(System.Web.VirtualPath virtualPath, bool ensureIsUpToDate) + 0xa2 bytes 
  System.Web.dll!System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(System.Web.VirtualPath virtualPath, bool noBuild, bool allowCrossApp, bool allowBuildInPrecompile, bool throwIfNotFound, bool ensureIsUpToDate) + 0x5b bytes 
  System.Web.dll!System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(System.Web.HttpContext context, System.Web.VirtualPath virtualPath, bool noBuild, bool allowCrossApp, bool allowBuildInPrecompile, bool throwIfNotFound, bool ensureIsUpToDate) + 0xcb bytes 

Problems converting VS 2003 project to VS 2008



I'm having problems converting a VS 2003 project to VS 2008 (tried 2005 as well, same problem). There are several problems;
a) I don't have VS 2003 installed.
b) The project is a web service, however I'm not sure what type of VS project it was created as.
c) The general knowledge about the project setup is..slim.

I get a error message using the conversion wizard, however, I'm not familiar with the tool and I cannot quite find any good information on Google for it, so I am left with a error message I do not understand.

Conversion Issues - myProject.csproj:
Unable to open the Web site 'C:\local\path\to\project\myProject.csproj'. The Web site 'C:\local\path\to\project\myProject.csproj' does not exist.

The web service is not intended to run on the dev machine, it is copied to a test or a prod server. However, I do not know how this was done previously. I'm thinking that in order to convert, it has to access the server on which it should run (which is set somehow in a config maybe). But that doesn't actually make any sence..

If anyone could shed light on this, I would really appreciate it.

Thank you.

.AspNet-Menu-Selected Problems


I am trying to have the selected item in the menu be noticeable different than the other items.  I am able to change the border as in the samples, but nothing else. I would like the selected font color to change as well as the background image / color.  Here is a sample page and style sheet.  Any help is greatly appreciated.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link href="MainStyle.css" rel="stylesheet" type="text/css" />
    <form id="form1" runat="server">
    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">
                    <!-- Indention Pushes First Link Over -->

Design Patterns: Problems and Solutions with Model-View-ViewModel


The Model-View-ViewModel (MVVM) design pattern describes a popular approach for building Windows Presentation Foundation or Microsoft Silverlight applications. Robert McCarter shows you how the ViewModel works, and discuss some benefits and issues involved in implementing a ViewModel in your code.

Robert McCarter

MSDN Magazine July 2010

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