STARTSESSION Exception

Mauddib
Member Posts: 269
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.
Any ideas? Is it possible there is some lock somewhere, that has not been released, that prevents this "exclusive exection" from running?
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?
0
Comments
-
Hi Mauddib,
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,0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions