WF 4.0 中 Persistence 异常

最近在跟着 WXWinter 学Workflow,收益非浅。 

根据 WXWinter 所提供的关于 会签业务流程 例子,自己也尝试了做一个流程控制,结果在 Persistence 时,出现了一个异常:

{"The execution of the InstancePersistenceCommand named {urn:schemas-microsoft-com:System.Activities.Persistence/command}CreateWorkflowOwner was interrupted by an error."}

找了半天,最后发现原来是数据库里缺少了System.Activities.DurableInstancing支持。

 

 

但这些是什么时候产生的呢?应该会有什么工具可以辅助我们执行相关操作吧。最后在一个老外那找到了一种方式:

http://coding.roecher.de/2010/02/08/could-not-find-stored-procedure-system-activities-durableinstancing-createlockowner/

如果有其他更好的方式,希望能分享一下

打开命令行,例如输入:

osql -E -S ServerName -d DBName -i C:\Windows\Microsoft.NET\Framework\v4.0.30128\SQL\en\SqlWorkflowInstanceStoreSchema.sql
osql -E -S ServerName -d DBName -i C:\Windows\Microsoft.NET\Framework\v4.0.30128\SQL\en\SqlWorkflowInstanceStoreLogic.sql

完成后,我们再到数据库里查看,就可以看到System.Activities.DurableInstancing的东西了。

 

当解决这个问题后,运行时,又出现了另一个异常,错误信息如下:

"The execution of an InstancePersistenceCommand was interrupted because the instance '340e56da-3d32-4ca6-9729-2fb5ed19a0cb' is locked by a different instance owner. This error usually occurs because a different host has the instance loaded. The instance owner ID of the owner or host with a lock on the instance is '954d7075-4937-49fe-9213-b2009c6dbcc1'."

还好, WXWinter 已经给出了 答案 ,我们需要将PersistableIdleAction设为PersistableIdleAction.Unload;

转载于:https://www.cnblogs.com/leoyo/archive/2010/03/31/1701558.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值