Nigel_A

Hi All

Is there a best practice for the length of time a workflow should be considered owned I do know that it's the length of time that a non-idle workflow should be locked to a particular workflow runtime instance. If my workflow has very short periods of activity followed by very long idle periods (up to several days / weeks), should I set the ownership duration to the maximum length of one of these periods of activity (which would be around 10 seconds), or some longer time

It's interesting browsing example code online, because some examples show the ownership duration as long (TimeSpan.MaxValue) and others short (5 minutes). In my own application, I've been setting the duration to 1 hour - with the only rational being that this was the duration that Mike Taulty set in his nugget video on persistence!!

I think I'd like to have a stronger reason than that for selecting the time. It's not that there's any problem with the application as is...

Regards

Nigel



Re: Windows Workflow Foundation Slightly lame question - how long should the instance ownership duration be on the SqlWorkflowPersistenceService

Kavita Kamani - MSFT

See this - http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=262046&SiteID=1

Does this help






Re: Windows Workflow Foundation Slightly lame question - how long should the instance ownership duration be on the SqlWorkflowPersistenceService

Anonymous

Hi Kavita

Somewhat...(There's no "somewhat helpful" button on the forums...pah!)

I think I want to know if it's OK to set the ownership duration to something a little as 10 seconds. Perhaps that's my real question!

Nigel





Re: Windows Workflow Foundation Slightly lame question - how long should the instance ownership duration be on the SqlWorkflowPersistenceService

ElifOn - MSFT

Hi

So here is some more information that i was able to dig and find for you:

" instanceOwnershipDuration is described as how long the particular host will "lock" the instance for itself. That is if you have 2 hosts accessing same workflow (same persistence db) then it specifies how long that particular host will take ownership for himself. This parameter should be set to the longest time any activity(chain of activities) in the worklfow executes till instance is persisted again.

" from http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1720016&SiteID=1

SO what you need to have is that if you are sure 10 seconds is enough of a time for your activities to execute then i would say why not. Additionally what i can say about the sample that has TimeSpan.MaxValue is that it probably has only one host for that workflow and there shouldnt be any other locking.

Hope this helps

Elif






Re: Windows Workflow Foundation Slightly lame question - how long should the instance ownership duration be on the SqlWorkflowPersistenceService

Kavita Kamani - MSFT

From what I understand, the answer to that question is yes. But as the post said, the value only matters if you have more than one runtime host sharing the same persistance service because its meant to avoid starvation of the other runtime host.




Re: Windows Workflow Foundation Slightly lame question - how long should the instance ownership duration be on the SqlWorkflowPersistenceService

Anonymous

Thanks All.

Nigel