2

문서 수명주기를 관리하기위한 비즈니스 로직이 있습니다.
이것은 Workflow Foundation 4 및 WF Persistence를 사용하여 구현됩니다. 워크 플로를 실행하는 동안 워크 플로에서 특정 책갈피가 만들어지고 예약 된 작업은 주기적으로 모든 특정 책갈피를 찾고 워크 플로를 다시 시작합니다. (실행중인 작업이 일부 프로세스를 처리하고 워크 플로를 다시 북마크하므로 워크 플로를 다시 시작할 수 있습니다. .DurableInstancing.InstanceNotReadyException의 원인이 될 수있는 문제는 무엇입니까?

 
System.Runtime.DurableInstancing.InstanceNotReadyException was unhandled 
    Message=The execution of an InstancePersistenceCommand was interrupted because the instance '99ce9413-5b17-4de0-a453-46891509e032' has not yet been persisted to the instance store. 
    Source=System.Runtime.DurableInstancing 
    StackTrace: 
     at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) 
     at System.Runtime.DurableInstancing.InstancePersistenceContext.OuterExecute(InstanceHandle initialInstanceHandle, InstancePersistenceCommand command, Transaction transaction, TimeSpan timeout) 
     at System.Runtime.DurableInstancing.InstanceStore.Execute(InstanceHandle handle, InstancePersistenceCommand command, TimeSpan timeout) 
     at System.Activities.WorkflowApplication.PersistenceManager.Load(TimeSpan timeout) 
     at System.Activities.WorkflowApplication.LoadCore(TimeSpan timeout, Boolean loadAny) 
     at System.Activities.WorkflowApplication.Load(Guid instanceId, TimeSpan timeout) 
     at System.Activities.WorkflowApplication.Load(Guid instanceId) 

이전에 동일한 인스턴스가 성공적으로로드 된 : 이상)

이제 워크 플로우의 실행중인 인스턴스의 일부, 우리는 다음과 같은 오류가 발생합니다.

나는이 예외에 관한 몇 가지 질문이 있습니다

  • 우리가이 예외를받을 수 있나요?
  • 이 예외가 발생하면 동일한 인스턴스를 나중에 다시 시작할 수 있도록 정상적인 방법으로 처리 할 수 ​​있습니까?
  • 또한이 예외로 인해 다시 시작할 수없는 기존 워크 플로 인스턴스를 수정하는 방법이 있습니까?

답변

0

지속적으로 워크 플로를 변경하는 개발 컴퓨터에서 사용하고 있습니까? 전에이 오류가 발생하여 영구 데이터베이스를 정리해야했습니다. 여기에 당신을 위해 스크립트가 있습니다.

use [AppFabricPersistenceStore] 

set nocount on 

declare @InstanceId uniqueidentifier 
declare @SurrogateInstanceId bigint 

declare csr cursor fast_forward for 
    select InstanceId from [System.Activities.DurableInstancing].Instances 

open csr 
fetch next from csr into @InstanceId 

while @@fetch_status = 0 
begin 
    (
     select @SurrogateInstanceId = SurrogateInstanceId 
     from [System.Activities.DurableInstancing].InstancesTable i 
     where i.Id = @InstanceId 
    ) 

    execute [System.Activities.DurableInstancing].DeleteInstance @SurrogateInstanceId 

    fetch next from csr into @InstanceId 
end 

close csr 
deallocate csr 

이 기능이 작동하는지 알려주세요.

관련 문제