Hello everyone. I have a problem in writing a function of web service.
In the web service, there is a function which available to one user only at one time. Therefore, I write some code in global.ascx like:
whenever the first user use the function, it change the value in application to his userId. Therefore any other user can see the change and do not allowed to use the function.
When the first user click "QUIT" button or "LOGOUT", the value in application will change back to -1. Therefore the next users can use the function now.
However, since most users seems not likely to obey the rule. Which just click X button at the windows right top end. Will cause the function be locked from any other users....
My problem is, since the user information is stored in his own session. At the time the session timeout, the server cannot unlock the value of Application too! (because server do not know whether the current user of function is timeouted or not)
I am quite a newbie to this type of web service. Please give me any idea you have. It will be helpful! Thank you!
In the web service, there is a function which available to one user only at one time. Therefore, I write some code in global.ascx like:
Code:
Application.Add(("SchHHGInUse"& Dt.Rows(i).Item("hhgId")),-1)
When the first user click "QUIT" button or "LOGOUT", the value in application will change back to -1. Therefore the next users can use the function now.
However, since most users seems not likely to obey the rule. Which just click X button at the windows right top end. Will cause the function be locked from any other users....
My problem is, since the user information is stored in his own session. At the time the session timeout, the server cannot unlock the value of Application too! (because server do not know whether the current user of function is timeouted or not)
I am quite a newbie to this type of web service. Please give me any idea you have. It will be helpful! Thank you!