Dynamics AX 2009业务连接器登录 [英] Dynamics AX 2009 Business Connector Logon

查看:122
本文介绍了Dynamics AX 2009业务连接器登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景: 我目前正在使用C#中的Dynamics AX 2009业务连接器. 对于我当前的项目,我需要连接到多个AOS服务器.理想情况是全部并行执行,尽管顺序执行就足够了.我可以成功连接到一台服务器(任何服务器),但是如果我尝试连接到另一台服务器(甚至是同一台服务器,但默认使用null而不是通过指定名称连接),则总是按LogonSystemChangedException ).如果我LogoffDispose前一个BC,将引用它的变量设置为null,让线程进入睡眠状态30秒钟,调用GC.Collect()(对不起-绝望的时光),然后创建一个全新的错误,我什至会收到此错误. BC在一个新变量中一起查看AX的另一个实例.这表明MS的代码在幕后有一些静态对象,这些对象在整个过程的生命周期中都将这些信息持久化.

Background: I'm currently working with the Dynamics AX 2009 Business Connector in C#. For my current project I need to connect to multiple AOS servers; ideally all in parallel, though sequentially would be adequate. I can connect to one server (any server) successfully, but always hit a LogonSystemChangedException if I try to connect to a different server (or even the same server but using null to connect to it as default instead of by specified name). I even get this error if I Logoff and Dispose the previous BC, set the variable referencing it to null, put the thread to sleep for 30 seconds, call GC.Collect() (sorry - desperate times) then create an entirely new BC looking at a different instance of AX altogether in an new variable. This suggests that MS's code has some static object behind the scenes which persists this information throughout the processes lifetime.

找到建议的解决方案:

  • 我在这里找到了建议的使用LogonAs以及AOS实例的正确格式的修复方法:

  • I found a suggested fix of using LogonAs along with the correct formatting for the AOS instance here: http://asonofmartha.blogspot.co.uk/2010/06/ax-net-business-connector-how-to-open.html - but have tried this with no luck.

到目前为止,我唯一发现的有效有效的方法是为第二个连接创建第二个进程,但这是一个不愉快的解决方案.

The only thing I've found so far which works is to create a second process for the second connection - but this is an unpleasant solution.

原因: 我连接多个AOS的原因是我正在编写一个CLR表函数,该函数连接到给定的AX实例,循环遍历该实例上的所有AOS服务器,然后返回所有客户端的列表.它们的SPIDS(仅在连接到该会话的AOS时可见).这是为了使我们的监视软件在看到数据库阻塞时能够返回有关AX用户会话的信息.

Why: My reason for connecting to multiple AOSes is I'm writing a CLR table function which connects to a given AX instance, loops through all AOS servers on that instance then returns a list of all clients & their SPIDS (which are only visible when connected to that session's AOS). This is to allow our monitoring software to return information about the AX user session when we see blocking on the database.

问题: 是否可以在同一过程中使用AX .Net业务连接器连接到多个AOS(如果无法并行,则依次连接)?

Question: Is there way to connect to more than one AOS using the AX .Net Business Connector within the same process (sequentially if parallel's not possible)?

推荐答案

前段时间,我遇到了这个问题,但没有找到解决方案.我通过雇主服务计划询问了MS,看来.NET BC存储了某种形式的连接数据缓存,直到整个过程结束才释放.计划不做更改,因为在下一个版本中将完全弃用.NET BC.

Some time ago I faced this problem and didn't get a solution. I asked MS through my employer service plan and it seems that .NET BC stores some kind of cache of the connection data that is not released until the entire process ends. This is not planned to change, as .NET BC is going to be fully deprecated on the next version.

我所做的是开发一个针对AOS运行的服务,然后运行该服务的三个实例,每个实例将信息从AOS收集到SQL表中,在那里我可以合并所有信息.

What I did was develop a service that ran against an AOS and then run three instances of the service, each of them gattering information from an AOS to an SQL table, where I could get all the information consolidated.

希望这会有所帮助.

这篇关于Dynamics AX 2009业务连接器登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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