Wednesday, April 29, 2015

3 Layer architecture with program and website

I hope I understand your problem correctly in that you are still getting that exception on your web site. If not please correct me.

A web site is multi-threaded by default so that multiple requests can be served independent of each other. This means that 2 incoming requests could potentially access your database at the same point in time. As long as your web site is on one server (not a multi-server setup, ie webfarm of some type) then you could use Monitor.Enter/Exit to syncronize access to the database. Again, this is not ideal. What you should really do is attach this database to a Sql Server instance which has no problems serving simultaneous requests.


Mark as answer or vote as helpful if you find it useful | Igor

No comments:

Post a Comment