Your question is not very specific, I will try to answer taking into account what you most quoted (DDD and DAL).
There is competition control at the level of request
, that is, requests Simultaneos has its own memory as a sandbox, they do not divide most states. An example of object that is divided is session.
Since Voce spoke more with focus on DDD and access to data (I imagine the bank), you have to do the control.
Suppose you’re using the EntityFramework
, Voce may have Simultaneos requests moving the same data, and this may be a problem.
Example: a reservation system, where user A can be with the seat window open, thinking where to sit. Meanwhile, user B also arrives on this screen and chooses seat 1. Coincidentally, user A also chooses seat 1 and fires the request along with user B, so that the 2 requests arrive on the server together. At this point, if your code does not treat competitive and simply execute User.MakeReservation(1)
for both users, Voce will get data loss.
There are several ways to deal with this, such as pessimistic and optimistic competition.
At the level of threads and everything else, every request, most of the time, will have its space, and within this space Voce has to deal with such competitors.
Raphael, Good afternoon I suggest you read the link article below, which deals with Domain Driven Design (DDD) and how to use it on . NET Framework http://www.devmedia.com.br/introducao-ddd-em-net/32724
– Jeordane Batista
Thanks Jeordanebatista! very good article, but I’m more in doubt is to the same competing use.
– Raphael
It depends on the way you are programming, if you are creating statics object, you should do this control.
– Lucas Lopes
Possible duplicate of Concurrency control in database insertion
– user26552
What exactly do you have in mind about concurrency control? The calls in controllers/actions? This is what Asp.net controls and IIS controls, now code stuff (like objects and lists in memory) you should implement.
– Ricardo Pontual