locked
Alternative to session? Need to fix concurrency errors with the session state provider + the aspprovider thread keeps backing off in AspProviders.ProviderRetryPoliticies RRS feed

  • Question

  • I'm using the session state provider that was given in the additional samples for Azure. 

    I'm running into a lot of locking issues with the session provider. Randomly on a page load, I will get an error either in the backoff (line 443 of Microsoft.Samples.ServiceHosting.AspPoviders.ProviderRetryPolicies in the SecUtil.cs file) that the aspprovider tries to do or something to do with the table being locked. Other times the page will load, but any following ajax requests or page loads either fail or take a few minutes to complete.

    I access some variables that I serialized a few times before every page load (in the controller, masterpage, viewpage using custom classes that inherit the controller, masterpage, viewpage as they all need these variables). So instead of having a trip to the DB on every page load and every on each different component, I save them in the session. They are rarely updated (usually only once when the user is logged in), but used throughout the application constantly. 

    Is there anything I can do to resolve this problem with the session state provider?

    I'm essentially using the session as a per-user cache (which is it's purpose) but with these errors, maybe there is an alternative I can use instead of the session? 

    Sunday, October 10, 2010 11:33 PM

Answers

  • Hello, just to solve the problem at hand (not having a trip to the DB on every page load), I think what you need is cache, rather than session. Currently distributed caching is not supported out of box. But normal ASP.NET cache is supported, and it can be used as is. You can create a data structure which associates a particular cached data with a user. The only concern is each instance manages its own copy of cache. But in your case, this shouldn't be a problem.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Yi-Lun Luo Friday, October 15, 2010 9:37 AM
    Monday, October 11, 2010 1:57 AM

All replies

  • Hello, just to solve the problem at hand (not having a trip to the DB on every page load), I think what you need is cache, rather than session. Currently distributed caching is not supported out of box. But normal ASP.NET cache is supported, and it can be used as is. You can create a data structure which associates a particular cached data with a user. The only concern is each instance manages its own copy of cache. But in your case, this shouldn't be a problem.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Yi-Lun Luo Friday, October 15, 2010 9:37 AM
    Monday, October 11, 2010 1:57 AM
  • Thanks, that's actually what I ended up doing. It seems to be working well and a bit faster.

    Is there any update on when Velocity will be available for Azure? Or are you aware of any production-ready cache project that can be used instead? The ability to have it work cross-instance would be nice. 

    Tuesday, October 12, 2010 1:45 AM
  • Velocity is on our radar. but sorry I can't share any ETA at the moment.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, October 15, 2010 9:37 AM
  • hello,

     

    i sholve the windows xp session problem.

    1.open mmc tool

    2.open file / add/remove snap in

    3.standalone

    4.add

    5.add fore computer menages

    6.finis

    7.extension

    8.revome to all extension

    9.only for add shares folder

    10.add to action

    11.connect to another computer

    12.go to shares folder and disconnect secession

    and save file..

    Please tray age.

    thanks.

    hardik prajapati

    email id :- hardik1020@yahoo.com

    Wednesday, January 19, 2011 6:46 AM