views:

20

answers:

1

Hi,

I'm working on a ASP.NET MVC 2 web application that lets users edit parameters on a simulation and launch it. Once a user starts editing a specific simulation, it must be inaccessible to other users.

Is there an easy way to achieve that goal in ASP.NET MVC?

My first idea was to put the logged on user's identity in the Application collection, along with the simulation: Application.Add((Guid)Membership.GetUser().ProviderUserKey, simulationId);

Then I would remove it in the Session_End method, when the session expires. However, the Session_End method is never called with those parameters in the web.config file: sessionState mode="InProc" timeout="1"

What am I doing wrong? / Is there a better mechanism?

A: 

Hard to do in a web application. Can you tell us why? usually collision detection is used in this instance and the first updater wins. The second updaters can either be told "refresh your data and retry" or you can try to apply or merge the changes and offer to save the newer version.

No Refunds No Returns
There are quite a lot of parameters to setup to launch a simulation, so I would prefer to notify the user upfront that somebody else is already in the same simulation.This is a web application that won't be used by a large amount of users, so performance isn't really an issue.
alex