Notifications
Announcements
No record found.
Thanks in advance,
Mark
*This post is locked for comments
Hi Mark,
I have the same problem.
In the event viewer the following message is logged:- RPC exception 3758096384followed by - The server terminated the session
Did you find the cause and a solution?Please share, thanks.
Best regards,Klaas Deforche
Hi,
From my experience, the key here is "Object Server 01: RPC error: Client provided an invalid session ID". This message is logged when the server has closed the session (session timed out or AOS instance restarted). The RPC error is of no use (unknown RPC error). Based on this, you should check if the AOS instance was restarted between after the BC session was initiated or if a time out has occured on the session. Also remember that the .NET BC is a multi session client.
No complete answer, but at least some tips for further investigations.
Hi Ax2009Tech,
You were right, that RPC error is of no use, the key was that the session was lost. I can reproduce the error:- I start my .NET windows service that uses the BC.NET- go to AX - Adminstration - Online users- terminate the BC.NET user sessions- execute an action that triggerd my service to use the BC.NET
What I then did, is add a try/catch to my service, and a loop so I could reconnect to AX with the BC in case the error occurred.
Like this:
public
The login method looks like this (logger is log4net object):
private
I'm no .NET expert, but that code worked for me.
Thx for the assistance, I hope this helps others too.
Best regards,Klaas.
I found the solution to my particular problem. I doubt it applies to you tho Klaas, there are probably much more common causes of this error.
I was using imersonation when initiating the connection to AX, then reverting it. This is a common partern that works for SQL. Using AX4, this seems to intermittently fail with the “Server has terminated the session” error (AX5 is fine). I stopped using impersonation and it has been working without any issues.
We faced the similar issue in AX 2009 (ax 5.0). Restarting the SQL services fixed the issue but would like to understand the core cause for the same. Any relevant guidance would help. Thank you.
I am curious about two aspects of your solution:
1. You stopped using impersonation, I assume this means that you started using Axapta.Logon() instead of using Axapta.LogonAs(), correct?
2. Also, you mentioned that previously you were using impersonation when initiating the connection to AX then reverting it, how do you revert impersonation when logging in to AX using the BC API?
best regards,
Gonzalo Garcia
We were actually using .NET impersonation just for the time we opened the connection (then reverted). Similar to what this article talks about www.codeproject.com/.../A-complete-Impersonation-Demo-in-C-NET
We now create a separate process for using the .NET BC as another user. Its a difficult thing to do if you need to communicate with that other process. The main reason we did that was to work around the problem where you can't connect to different AOT's more than once (something most of our users were trying to do).
I can't remember why we weren't using the LogOnAs method. I believe it required a proxy account in ax to be set up?
Yes, LogonAs requires a proxy account setup in Active Directory and in AX. We are facing the same problem you were experiencing only that we are using LogonAs, the connection interruption is intermittent and the error pattern in the event viewer is exactly the same, I guess LogonAs uses impersonation at some point. Thanks for your time and help!
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2