Asp.net 2003 force method to finish before processing next

  • Thread starter Thread starter Jerry J
  • Start date Start date
J

Jerry J

I am using C# with asp.net 2003. I have a method on a web page that has
problems if it is accessed at the same time from more than one client. If it
is called by more than one client, I want to force the method to act
sequentially. I am pretty sure there is somekind of server call that will
allow me to force other callers to wait for the previous call to complete,
however I can't figure out what it is. It would be something like

Application.BeginSequentialProcessing;
MyMethod();
Application.EndSequentialProcessing

How do I do this?
 
Is there an alternative to application.lock ? I would rather just lock the
page, not the whole application.
 
Jerry said:
I am using C# with asp.net 2003. I have a method on a web page that has
problems if it is accessed at the same time from more than one client. If it
is called by more than one client, I want to force the method to act
sequentially. I am pretty sure there is somekind of server call that will
allow me to force other callers to wait for the previous call to complete,
however I can't figure out what it is. It would be something like

Application.BeginSequentialProcessing;
MyMethod();
Application.EndSequentialProcessing

How do I do this?

lock(someobject)
{
...
}

maybe.

Arne
 
Arne Vajhøj said:
lock(someobject)
{
...
}

That sounds good...although the only way I can imagine this working is if
someobject is a static member of the MyPage class. What do you think?

- Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top