XRM/Dynamics CRM 2011 中 OrganizationServiceProxy 的连接/对象池
我正在编写一个 MVC 3 WebApp,它使用 Early Bound 使用 XRM 2011。这是一个面向 Internet 的应用程序,托管在与 Dynamics IIS 不同的计算机上。
这当然使得 OrganizationServiceProxy 调用非常非常频繁,并且每次第一次点击时响应都有点迟缓。
是否建议重用 OrganizationServiceProxy 连接而不是每次都创建新实例?
如果是,
- 是否有任何东西可以管理连接,例如
- 连接池应用 - MS 或第三方/开源
- 或者像WCF这样的框架(还没有使用过WCF)
- 如果我必须编写自己的代码来管理连接,建议使用哪种设计模式?
很抱歉 MS 网站上有重复的帖子。希望这个论坛更加活跃。
I am writing a MVC 3 WebApp which uses XRM 2011 using Early Bound. This is an internet-facing application hosted on separate machine than Dynamics IIS.
This of course makes OrganizationServiceProxy call very very frequently and response is kind of sluggish on every first hit.
Is it advisable to reuse OrganizationServiceProxy connection rather than create new instance every time?
If yes,
- Is there anything to manage the connections such as
- connection pool app - MS or third party/open source
- or some framework like WCF (Never used WCF, yet)
- Which design pattern is recommended if I have to write my own code to manage connection?
Sorry for the duplicate post from MS website. Hopefully this forum is more active.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
经过几个测试周期,我发现使用 CrmConection 是最快的方法。与上述缓存实现相比,CrmConnection 的运行速度至少快 5 倍。
After few test cycles, I have found that using CrmConection is the fastest method. Compared to above caching implementation, CrmConnection runs at least 5 times faster.
这是一个相当老的问题,但对于仍在寻找的其他人来说,请阅读此 SDK Microsoft Dynamics CRM 2011 和 Microsoft Dynamics CRM Online 的扩展。我相信扩展会为您处理资源的缓存/池化。
有关OP原始问题的解决方案,请查看 此处和此处。以下是上面链接的 CRM SDK 文档的引用:
This is quite an old question but for anyone else still looking have a read of this SDK Extensions for Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online. I believe the extensions take care of the caching/pooling of resources for you.
For a solution to OP original question have a look here and here. Below is a quote from the CRM SDK documentation linked above:
我还在 MS 论坛,我在其中得到了 Pat 的以下回复。
根据该建议,我最终使用了 API 示例代码中的以下类。如果有人对此有反馈或正确/错误/更好的建议,请告诉我。
至于AppPool的管理,我仍在寻找信息。
我将以下连接字符串添加到 web.config
然后创建以下类来创建连接。
以下 MVC 代码消耗连接:
I also posted this question on MS Forum where I got following reply by Pat.
Based on that advise, I endedup using following classes from the API sample code. Please let me know if anyone has feedback or right/wrong/better advise on this.
As far management of AppPool is concerned, I still looking for info.
I added following connection string to web.config
Then I created following class to create connection.
Following MVC code consumes the connection: