Can check constraint be used instead of pessimistic locks ?
Consider there is following table in SQL Server:
create table Balances(
id int,
userId int,
balance money)
If more than 1 thread try to change the balance will check constraint solve any
concurrency problem or locks should be used ?
Also, I wonder if check constraints has the same behavior in other relational databases such as Postgres ?