System.Web.HttpContext HttpContext = System.Web.HttpContext.Current;
Hashtable departmentsalary = (Hashtable) httpcontext.application["Departmentsalary"];
Try
{
if (departmentsalary! = null && departmentsalary.containsvalue (KEYID))
{
Throw Serviceexception.newexception (Methodbase.getcurrentmethod (). Name + ": The XXXX has been operated by someone");
}
Departmentsalary = new Hashtable ();
Departmentsalary[httpcontext.session.sessionid] = KEYID; Initialize the current user's SessionID
HttpContext.Application.Lock ();
httpcontext.application["departmentsalary"] = departmentsalary;
HttpContext.Application.UnLock ();
Invoking the WCF interface
}
catch (Exception)
{
Throw
}
Finally
{
Departmentsalary.remove (HttpContext.Session.SessionID);
HttpContext.Application.Lock ();
httpcontext.application["departmentsalary"] = departmentsalary;
HttpContext.Application.UnLock ();
}
MVC WCF concurrency hint, store application, verify that there are users in action