zoukankan      html  css  js  c++  java
  • 由WorkflowOwnershipException 异常,联想出的部署犯案

    首先我们来看看 "WorkflowOwnershipException "异常在MSDN里面的解释:
    原文:The exception that is thrown when the workflow runtime engine attempts to load a workflow instance that is currently loaded by another workflow runtime engine instance. Additionally, this exception is thrown when the workflow runtime engine attempts to save a workflow after the ownership timeout that was specified while loading the workflow has expired.
    根据本人巨烂的英语水平翻译得出的结论:
    该异常出发的原因有二:1.引擎试图读取一个正在被其他引擎加载的工作流实例时抛出
                                                2.使用过期的引擎读取工作流实例
    以上是错误的解释,微软的注释难免让人有种知其然不知所以然的感觉。
     
    原因1很简单。无非就是某个其他的引擎和本引擎其冲突。
    主要讨论以下原因 2.使用过期的引擎读取工作流实例:
    在InstanceState表中有字段OwnerID和OwnedUntil。
    这两个字段分别代表拥有控制该实例的Runtime的ID和该Runtime过时的时间!
    问题就在于这里,虽然仍然不知道为什么,仅仅在创建实例后OwnerID和OwnedUntil字段仍为空,但再次加载并控制实例后两个字段会含有上一次控制该实例的Runtime信息以及过时信息

    但是我们仍然可以发现解决问题的方案:
    1.在初始化Runtime的时候需要绑定SqlPersistenceService,而此时初始化SqlPersistenctService时的参数OwnerShipDuration不可设置太大,太大就会导致即使第一次操作退出,可已经消失的Runtime仍然拥有该实例
    后续操作无法进行

    2.在GetWorkflow之前最好也手工检测一下字段OwnedUntil值是否早于当前时间如果,如果OwnedUntil还未到,代表当前不可获取该实例!只好等待

    以上仅仅是对开发过程中现象的判断,完全个人意见,不具权威性,供大家分享,不妥之处也请指教
  • 相关阅读:
    expect脚本实例
    Linux dialog详解(图形化shell)
    makefile——小试牛刀
    gdb入门
    linux常见系统调用函数列表
    linux前后台任务的切换以及执行暂停
    centos 7.0 lnmp安装部署步骤
    环境列表
    setjmp与longjmp非局部跳转函数的使用
    malloc,calloc,alloca和free函数
  • 原文地址:https://www.cnblogs.com/vincedotnet/p/882827.html
Copyright © 2011-2022 走看看