Hi all,
Just started today playing with START SESSION for the first time on 2015. I created a very simple codeunit which called:
STARTSESSION(myint, 50054, COMPANYNAME);
STOPSESSION(myint, '');
And the codeunit 50054 had a very simple ERROR in it.
I ran it twice and I got my error in the EVENT LOG just fine as I expected to.
However since then when I try to run my codeunit I get a WARNING in the event log about an exception, and the code in CU50054 no longer runs. The same error comes no matter what Service Tier I connect to my database through. And both STARTSESSION and STOPSESSION are returning "TRUE" as if there was no real trouble.
Server instance: node2
User: MYGROUP\myusername
Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavSessionTerminatedException
Message: Der Server hat die Sitzung (ID: 151) aufgrund einer Anforderung zum Anhalten der Sitzung angehalten.
StackTrace:
bei Microsoft.Dynamics.Nav.Runtime.SessionAccessLock.ThrowSessionTerminatedException()
bei Microsoft.Dynamics.Nav.Runtime.SessionAccessLock.BeginExclusiveExecution()
bei Microsoft.Dynamics.Nav.Runtime.ALSession.RunCodeunitAndDisposeSession(NavSession session, Int32 codeUnitId, NavRecord record)
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2146233088
Any ideas? Is it possible there is some lock somewhere, that has not been released, that prevents this "exclusive exection" from running?
Comments
you can't start a new session with the same ID again, you have to use a different ID.
you can find the next ID using the Session Event (virtual) Table
Cheers,