nkorobkov / lfmsh_bank

A full-sized web accounts management system to support the virtual economy.
htpps://nkorobkov.com/projects/bank
9 stars 5 forks source link

Add locking of db for transaction operations #27

Open nkorobkov opened 4 years ago

nkorobkov commented 4 years ago

Now transaction logic does not block the row in DB. So double spendings and related issues may occur.

Need to implement pessimistic locking (like described in this blog post: https://hakibenita.com/how-to-manage-concurrency-in-django-models) With the use of related fields lock.

So that every transaction operation (process, substitute, decline) would block account while processing.