Is using asmx service to update a session variable via ajax call a problem when a lot of calls are made in succession?
I have a asmx (project is legacy ASP.NET with no WCF at the web application layer) webservice that updates a session variable. There is an ajax call that uses this method when a checkbox is clicked. It works unless you click the check boxes one after another (which could be done). The ajax call hangs (never finishes).
I’m thinking this has something to do with multiple requests trying to update the session variable, but I’m not sure. Anyone run into this and could lend some advice? Note: I know WCF would be a possible answer, but I wondering if there is a solution that won’t require changing the asmx service to WCF right now.
Yes, as ASP.NET will queue and execute those requests sequentially and not in parallel because the session object is not thread safe. If multiple requests from the same session are sent to some ASP.NET handler and if this handler writes to the session it will simply queue those requests.