CRM 2011工作流程和QUOT;无效指针"错误 [英] CRM 2011 Workflow "Invalid Pointer" error

查看:489
本文介绍了CRM 2011工作流程和QUOT;无效指针"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CRM 2011年自定义工作流是手工触发对自定义实体的记录。当选择用于处理单个记录,工作流是总是成功的。然而选择多个记录时,至少有一个会失败。提供的错误(多个)似乎以改变从一个试图对下,即使正在使用的数据相同。

I have a custom workflow in CRM 2011 which is manually triggered against custom entity records. When a single record is selected for processing, the workflow is always successful. However when selecting more than one record, at least one will fail. The error(s) provided seem to vary from one attempt to the next, even though the same data is being used.

到目前为止,我所遇到的错误是:

Errors I've encountered so far are:


  • ValidateOpen - 当它应该遇到处置CrmDbConnection
    不设置不能从另一个
  • 创建一个SqlExecutionContext
  • SqlExecutionContext上OnBeginRequest没有被调用

  • ValidateOpen - Encountered disposed CrmDbConnection when it should not be disposed You cannot create a SqlExecutionContext from another
  • SqlExecutionContext on which OnBeginRequest has not been called

和重新启动数据库服务器后:

And after restarting the DB server:


  • 无效指针

所有这些调用IOrganizationService的更新方法时发生。无效的指针错误似乎是因为具有重新启动数据库服务器(有人建议,我认为这可能与过度繁忙DB服务器的问题)比较常见的错误。我也删除了异步任务的情况下,这是问题的积压,但一直没有任何效果。

All of these occur when calling the Update method of the IOrganizationService. The Invalid Pointer error seems to be the more common error since having restarted the DB server (it was suggested to me that it might be an issue with an overly-busy DB server). I've also deleted any backlog of asynchronous tasks in case this was the issue, but it hasn't had any effect.

有谁知道这是什么错误意味着,为什么我可能会得到它,或者我怎样才能解决这个问题?

Does anyone know what this error means, why I might be getting it or how I can get around the issue?

非常感谢!

推荐答案

看来此错误消息是说,'试图打开到CRM另一个连接时previous之一就是开放的迂回的方式,和的原因它试图这样做是为了处理多个记录时,它只是失败的事实非常重要。

It seems this error message is a round-about way of saying, 'tried to open another connection to CRM when the previous one was open', and the reason it tries to do this is very much relevant to the fact it only fails when processing more than one record.

参考本博客:

看来,当一个工作流对多个记录上运行,它使用的类,这意味着,类级变量将不会执行之间重新实例化的相同的实例。所以,当后续执行来到code这台类级服务变量到IOrganisationService的实例,它找到的变量已经有一个,它是开放的。

It seems that when a workflow is run against multiple records, it uses the same instance of the class, which means that class-level variables won't be re-instantiated between executions. So, when subsequent executions come to the code which sets the class-level service variable to an instance of an IOrganisationService, it finds the variables already has one and that it's open.

我发现最简单的解决方案,以实现它具备执行功能中的服务的变量,而不是类级别。这已经无处不在解决了这个问题,因为我已经试过了。

The solution I've found easiest to implement it to have the service variable within the Execute function, rather than class-level. This has solved the problem everywhere that I've tried it since.

这篇关于CRM 2011工作流程和QUOT;无效指针"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆