user session
ningnongjin
Member Posts: 42
Hi All,
Scenario:
Would like to check the number of sessions currently active in MS SQL Server, by going to File -> Database -> Information. Under Sessions tab, select the Lookup arrow and the error prompts this message
The following SQL Server error(s) occure while accessing the Session table:
535,"22003",[Microsoft][ODBC SQL Server Driver][SQL Server]Difference of two datetime columns caused overflow at runtime.
Have anyone encounter the same problem before and what's the cause and solution towards this. Thanks in advance
Kind Regds,
NN
Scenario:
Would like to check the number of sessions currently active in MS SQL Server, by going to File -> Database -> Information. Under Sessions tab, select the Lookup arrow and the error prompts this message
The following SQL Server error(s) occure while accessing the Session table:
535,"22003",[Microsoft][ODBC SQL Server Driver][SQL Server]Difference of two datetime columns caused overflow at runtime.
Have anyone encounter the same problem before and what's the cause and solution towards this. Thanks in advance
Kind Regds,
NN
0
Comments
-
Yes, this is problem of the new field "Idle time" - if there is some session idle for long time, the field overflow... (and it can be session which is not Navision session...)0
-
Workaround - you can alter view Session on the MS SQL server to not allow Idle Time to be bigger than some max limit...0
-
thanks for the reply..so what you're saying is that it could be another session opened for other application that sits on the same server as the Navision application?i would try this method out then...thanks once again0
-
so this 'Idle time' field where it is evident in Navision?0
-
You can see it (in normal conditions) in the table sessions (sessions list) - the form, you are not able to open because error... the time is too big for Navision to show it... - it exist only in 4.00...0
-
hi kinke,
thanks for the prompt reply. as this problem happens when the idle time has grown too big. So i assume to counter this problem, i have to set an idle time in MS SQL to constraint it. But if i start afresh by killing every session and then re-log in again, and when i check the active sessions i presume the error message would not appear as the error only occurs if the inactivity of the session is greater then the idle time being set. am i right on this matter?just trying to understand how the idle session works as i'm new to this matter cause i did not do any changes or mods to the SQL idle setting or let alone understand how it worked in the first place. thanks in advance.0 -
ningnongjin wrote:So i assume to counter this problem, i have to set an idle time in MS SQL to constraint it
How did you constraint it? Did you changed the definition of the Session view on the server?But if i start afresh by killing every session and then re-log in again, and when i check the active sessions i presume the error message would not appear as the error only occurs if the inactivity of the session is greater then the idle time being set.
You are not able to kill all sessions manually. Some sessions (processes) are system processes and you are not able to kill them. You have two ways:
1) restart MS SQL server - all processes will be restarted
2) exclude system processes from Session view... for example setting the view to list only processes with PID >=50
The session list work in this way:
In your DB on MS SQL server is defined one view with name Session. This view read data from many sources and create virtual table with all data which Navision show.
For example Idle time field is defined as:CASE WHEN SP.[cmd] = 'AWAITING COMMAND' THEN CAST(DATEDIFF(SECOND, SP.[last_batch], GETDATE()) AS BIGINT) * 1000 ELSE 0 END AS [Idle Time]which means - if status of the process is AWAITING COMMAND (doing nothing) than calc time difference between time of last command and NOW (*1000 to have milliseconds) else return 0... You can change this definition to return maximal value which Navision can handle (Duration type which Navision is using for this field is 64bit integer).0 -
Hi Kine,
Sorry for the misspelling earlier on. Ok i get an idea already on your explanation. So in this matter, i'm unable to kill the session manually because i can't check it in the first place, so does it mean when user logs off from Navision does it still registers it as an active session?
the problem occured due to client saying that they had not reached the number of concurrent users allowed as they have head counted who is logged in, but when i tried checking it, they can't proceed coz they have reach their user sessions limits. I'm afraid because of this Session issue that has actually caused Navision to register one or two active sessions after all users have been logged off.
thanks in advance0 -
No, after logout, the session (MS SQL process) is terminated. Of course, if you are using for example terminal server for connecting to Navision DB, you can have some TS sessions which was disconnected but are still runing Navision. Check your Terminal server for disconnected sessions.ningnongjin wrote:So in this matter, i'm unable to kill the session manually because i can't check it in the first place, so does it mean when user logs off from Navision does it still registers it as an active session?
If you are not able to open the session list from Navision, you can still open it through MS SQL Enterprise Manager or through MS SQL Query analyzer...
for example through command:select * from <DatabaseName>.Session
0 -
thanks kine for your replies. your help is greatly appreciated0
-
Anybody fixed the view, and would mind posting the code for this issue? Thanks0
-
Hi,
i solved this by modifying the Session view this way:
and (SP.[program_name] like '%Navision%')0 -
Another solution than Deblocker's is to change definition of [idle time] field to something like:
CASE WHEN SP.[cmd] = 'AWAITING COMMAND' THEN (CASE WHEN SP.[last_batch] < DATEADD(day, -30, GETDATE()) THEN 999999999 ELSE CAST(DATEDIFF(SECOND, SP.[last_batch], GETDATE()) AS BIGINT) * 1000 END) ELSE 0 END AS [Idle Time]
In this case, if the session is idle more than -30 days (it is just example, it is some limit, which prevent to have overflow), the idle time will be 999999999 ms.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
- 322 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

