How does license release work in AR, Midtier, Smart IT

Version 2
    Share This:


    Windows User Tool was always holding a connection to the AR server and that’s why it was consuming an AR user license. When the user exited User Tool gracefully i.e. logout option or closed the User Tool using X icon, license had to be released. This was job of the User Tool by capturing logout or close events and sending releaseLicense() call to server. User Tool, being a Windows thick client program, it could control this. If the user left their User Tool running idle or it crashed, User Tool couldn’t release the license. Then it is server’s responsibility to use Floating License Timeout (hours) i.e. 2 hours default to release that user’s license and make it available for others.


    So, there are 3 ways that can release a license –

    1. Explicit logout by user
    2. Explicit close of the client application by the user
    3. Server releasing license because of idle user.


    What changes in Web Applications like Midtier and Smart IT

    Given that User Tool is deprecated, we still must have the same behavior like User Tool for web applications also. In context of Midtier and Smart IT, we have to ensure all 3 ways of license release. #1 and #3 are not a problem, since #1 is explicit action by the user in our own web application and #3 is done by server.


    However, #2 is a problem in any web app, since the control is outside midtier i.e. X of web browser or refresh of the browser page. There can be multiple browser windows and user may close the browser window or a single tab, without giving a chance to midtier to give enough time to release the license. This is where midtier’s License Release Timeout setting (default 60 seconds) comes into picture.


    How does License Release Timeout setting in Midtier work?

    Midtier tries to capture browser close event and is successful most of the times (unfortunately this is at the mercy of the browser) and sends a lightweight backchannel call (or REST call in Smart IT) to start a timer to release license in 60 seconds default, usually this call is successful. However, if midtier hears back from the same browser session within those 60 seconds, timer is canceled and license is not released. The reason for this implementation is – browser close event may happen because of user closing the browser or refreshing the browser or navigating away to different website and this is something any web application will not know about. Hence if user really closed the browser window, midtier will not hear back from same user session in 60 seconds and will release license. If it was refresh of the browser window, midtier will hear back from the refreshed form from our application itself and it will cancel the timer to release license.


    NO, Midtier or Smart IT idle session timeout DOES NOT release a license

    Remember that any web application (or user tool or any API program) is a client to the AR server and is responsible for sending releaseLicense() call to server to release the license. Session timeout of the client has no bearing on the AR server license. Consider Midtier or Smart IT session timeout to be of 30 minutes. When user has logged in, but is idle for more than 30 minutes, but less than 2 hours (Floating License Timeout setting in server), it is only an indication to midtier or Smart IT that user is idle. These applications will NOT send releaseLicense() call to the AR server in this case, as client program must be explicit based on a User Action, not a system action. Releasing a license based on timeout is only AR Server's responsibility, not client's.