2

I have a process within my MVC 2 application that takes a large amount of time and alters many rows in the database in the process.

There is a chance that two or more users could attempt to perform this action at the same time, which would lead to undesirable effects.

Is there a way to set a global flag somewhere within asp.net that I can check against all requests to see if the action in question is currently being executed? (a bit that I flip prior to running query, and then then flip back on completition)

Or is there a better way of handling this situation?

Thanks

1

2 Answers 2

3

You can use the Application object - it is part of the HttpContext.

Sign up to request clarification or add additional context in comments.

Comments

2

MVC is built on Asp.Net core. You can use Application object to store with proper locking.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.