Sorry for my ugly english.
there is a situation: two database users are trying simultaneously to sale good (name it good1) of amount of 5 pieces each of user. at depot we have just 5 pieces of good1. and one of these sale documents should not be permitted. who to do it on SQL database?