410-gone - keepAlive?

2 posts, 0 answers
  1. Bridge24
    Bridge24 avatar
    89 posts
    Member since:
    Jan 2009

    Posted 20 Jan Link to this post

    Hi, we are using reportViewer + reportServices, in a single-page application.

    We configured SQL server storage, and we set an expiration of 12 hours.

    Problem is, when the user let its screen opened, and come back the day after, and he clics "next page", or change the parameters to generate a new report, we get the "410 Gone" error.

    Yes, we can increase the timeout to 24 hours, but what about weekends?
    Ok we can set it to 7 days... but we don't want to.

    We try to catch that error in the "error" event of the viewer, but depending on the action we take, the error is not always the same, and we get wrong informations about the real cause of the error. When refreshing data, there's no informations about expiration of the instanceID.  We only get it when navigating on an existing report.

    If I change the page, I get a "gone" error message.

    If I change the parameters, I get something else.

    When I look at fiddler, and I catch my "xhr" error at high level, I can trap these 410 errors. 

    The question is:

    Is it possible to start a new session from scratch when we detect that issue without restarting the application (F5)? 
    We think about calling refreshReport every 3 hours, but it's not a gold solution...

    I think that you should implement "keepAlive" process to keep the clientID always ready when the viewer is loaded on screen.

    Also, after a few months, we see that the SQL database is full of outdated data, I did not find any official method to say to the storage "Delete all temp data older than 7 days". 

    I created a stored procedure based on the "tr_string.values" data, but it's not the best.

    (SELECT * FROM tr_String AS ts WHERE LEN(VALUE) = LEN('yyyy-MM-ddThh:mm:ss') AND VALUE < '2020-01-13T00:00:00')

    From that query, I am able to destroy outdated ids from 4 tables. But, is there a better method?

    Thank you

  2. Todor
    Todor avatar
    451 posts

    Posted 23 Jan Link to this post

    Hi Daniel,

    We have a similar feature request you can vote for - Keep session alive while the viewer is opened in a browser window. The number of votes increases the feature requests priority.

    Indeed, the client session will expire based on the ClientSessionTimeout property of the REST Service. Periodically (each 5 min), the Rest Service performs cleaning of the expired sessions. Note that in order for the service to clean the inactive sessions it has to be awakened by a request from an active client/viewer. Hence, all inactive sessions will be deleted after some time that is determined by the ClientSessionTimeout and the time intervals in which the inactive sessions get removed from the service, provided the service is awake. 

    If you don't want to increase the ClientSessionTimeout, you should keep the session alive, for example by refreshing from the same client. When the user returns and the session has expired, an error message should be displayed upon clicking on a Toolbar button, stating that the session has expired. The message also states that the user may use the Refresh button to create a new session.

    To answer your first question, it is not required to restart the application to initiate a new session. The user just needs to click Refresh or another Toolbar button, and the new session will be automatically created. You may also call refreshReport periodically to force a new session to be created, or the old one to be kept alive.

    Addressing the second question, if the service stops before the client sessions have been deleted (including before it has been awakened to delete them), the uncleaned sessions will remain in the Storage. The data will be useless, but it will not be removed as the REST Service has already stopped before there has been a request to awaken it and let it automatically clean the expired storage data. In such cases, you need to manually clean the storage as you have found out. I don't think currently there is a better way.

    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top