Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Pending sessions web service locking tables

(0) ShareShare
ReportReport
Posted on by

Hi Everyone,

I'm consuming NAV web services with web application in .NET.

The code creates connections with a default user (shared between multiple users) and connection for each user. The authentication I'm using is Windows Credentials.

I've noted that after I consume a web service the session, also if the connection will be closed and disposed, remains in NAV. Sometimes a pending connection can create delay or lock some table.

Did someone have a similar issue? Is there a parameter to set to force the close of the session after the web service has been consumed?

I've tried everything in .NET but not solution so I think is NAV that maintain the Session maybe to reuse it or for caching purpose.

Thanks for your thoughts
   Eclipses

*This post is locked for comments

  • Sergio Castelluccio Profile Picture
    on at
    RE: Pending sessions web service locking tables

    Hi Tharanga,

    Let me understand better your comment:

    I call a method via Web Service and at the end of the method itself i should insert a code to close the session?

    This is the first part where you say that the code ti kill the session will be on NAV.

    Then you suggest to do it on SQL but no Idea how to know when i can kill the session, that should be after the the Web Service has been consumed.

    I think that if a call a method and inside there is the code that kill the session the integration will fail consuming the Web Service, obviously is to test. The second part is not clear for me cause the Session that I can see in the Active Session table in NAV are different of the sessions in SQL.

    Best Regards

     Eclipses

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: Pending sessions web service locking tables

    Just a suggestion,

    Can't you write a small code to kill the session in NAV once you finish the integration? Will that help? You can write this on the SQL side. (Just an idea)

  • Sergio Castelluccio Profile Picture
    on at
    RE: Pending sessions web service locking tables

    Hi Nareshwar,

    Unfortunately NAV leave in the Active Sessions connection idle and sometimes also connection closed (e.g. a client crashed). To refresh the list you should restart the Nav Service.

    The issue is identify the sessions to kill cause are idle.

    I suppose it works so as per design, so I cannot open any BUG to Microsoft but maybe I have to change the design of the solution.

    I hope someone else that faced similar issue will share his thoughts.

    Thanks 

      Eclipses

  • Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at
    RE: Pending sessions web service locking tables

    Hi Sergio,

    As per theory, since the webservice calls are for a short period of time, it automatically closes the connection after the processing. If not there will be a conflict with concurrent users in the license what you have purchased.

    By the way, this is a good read: dynamicsuser.net/.../nav-2013-2015-session-counting

    Also this question: forum.mibuso.com/.../kill-session-after-using-web-service

    But, can you provide me with code snippets and methods that you have tried?

    Also, we use STOPSESSION() function to force-stop the sessions from C/AL, but I am not sure how it is helpful in .NET.

    Hope it helps.  

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.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans