I'm running a workflow runtime that contains an SqlWorkflowPersistenceService & SqlTrackingService (with IsTransactional = true)
WorkflowInstance workflowInstance = _workflowRuntime.CreateWorkflow(workflowType);
workflowInstance.Start();
// Assure persistence
workflowInstance.Unload(); // Error occur here
workflowInstance.Load();
The error I'm getting is:
PersistenceException "Cannot access a disposed object.\r\nObject name: 'Transaction'."
at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation)
at System.Workflow.Runtime.WorkflowExecutor.PerformUnloading(Boolean handleExceptions)
at System.Workflow.Runtime.WorkflowExecutor.Unload()
at System.Workflow.Runtime.WorkflowInstance.Unload()
Everything works fine if i'm not adding the SqlTrackingService or setting it's "IsTransactional" to true
Edit: This error occur only when using a remote database. The exact same code will work if executing it from the database computer.