How to control/kill sessions?

13»

Comments

  • krikikriki Posts: 8,768Member, Moderator
    NAV2009 has become 'more resistant' to network timeouts (Or going into standby for portables).
    The result is that you can kill a session as you noticed, but the client is still able to restore the session if there are enough licenses left and if the client wasn't communicating with the server at the moment the session was killed. In this last case you have a big probability that the session gets some weird errors. Closing the database and reopening fixes it.

    I find it a positive "bug". You free a session and a license and if the user reuses his killed session after a day or 2, it seems it is still active. So you have the advantage of freeing licenses AND the positive of always being connected to the server.
    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
    NAV TechDays 2019: 21 & 22 November 2019, Antwerp (Belgium)
  • prasad4spprasad4sp Posts: 4Member
    hi Kriki,

    Thanks for your reply.

    Agree with you on certain extent, but still

    If Sessions are keeping active after session entries getting deleted(using code), due to network issues or license availability for more sessions, then why this is not the same case with manually deleting the session entries.

    Agree if this is a bug in Navision, but why this is not behaving in same manner for both cases, I mean when I am deleting session entries manually and when I am deleting session entries using session killer code.
  • krikikriki Posts: 8,768Member, Moderator
    prasad4sp wrote:
    If Sessions are keeping active after session entries getting deleted(using code), due to network issues or license availability for more sessions, then why this is not the same case with manually deleting the session entries.
    Thanks for noting this. I never noticed there is a difference between killing sessions by code or directly in the session form.
    After some testing this out I found this:

    Killing a session using the form kills the session permanently.
    Killing a session using C/AL DELETE(TRUE) kills the session permanently.
    Killing a session using C/AL DELETE(FALSE) kills the session 'temporarily' (in 2009R2. Older versions (don't know exactly which are permanently)). The session killer is using the DELETE(FALSE). If you change it to DELETE(TRUE), it will kill them permanently.
    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
    NAV TechDays 2019: 21 & 22 November 2019, Antwerp (Belgium)
  • johannajohanna Posts: 367Member
    Dear Kriki,

    I have tested the code Session.DELETE(TRUE). The result is the session has deleted, but I still can access the RTC. Is there any setting that I did not set?

    For your information, if I delete the RTC session in database session manually, the RTC connection is not closed. If I clear the RTC session in database session manually, the RTC connection is closed.
    How to clear RTC session in C/AL Code?

    Thanks in advance.
    Best regards,

    Johanna
  • krikikriki Posts: 8,768Member, Moderator
    Actually, the session is killed. But NAV2009R2 (both Classic and RTC) has the ability to recover from a "lost" session. And if there are are still sessions over in the license, NAV can connect as if nothing happened. But the session is freed for others to take if needed.
    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
    NAV TechDays 2019: 21 & 22 November 2019, Antwerp (Belgium)
  • johannajohanna Posts: 367Member
    Dear Kriki,

    Okay.. Thank you for your information :D
    Best regards,

    Johanna
  • Stella567Stella567 Posts: 6Member
    thank you for information!
    your forum is really helpfull for me!
Sign In or Register to comment.