New answers tagged concurrency
you need optimistic locking for that. Create a unique constrain in the table order something like itemid + createdat + userid. That will guaranty that not duplicate orders will ever happen. At the same time avoiding pessimistic locking. Them for updates you would required something like row-version (Martin Fowler Offline Lock)
Concurrency and isolation are the two topics you are dealing with here - the ability for more than one user to use the system simultaneously and for each's work to be unaffected by the others'. RDBMS handle this through isolation levels and locks. It is how they are designed to work; it is what they do. Our job as application architects is to choose settings ...
Top 50 recent answers are included