I am doing a financial application in which I am expecting a data concurrency issue.
Suppose there is an account ABC which has $500 in it. User from web can transfer these funds to other accounts. This will involve 2 steps 1st checking availability of funds and 2nd transferring. I am making a transaction and doing both acts in it.
Problem is when in a time (say Time1) there are 2 or 3 seprate requests for transferring (say transaction1,transaction2, transaction3) same amount. Now committed available amount is $500. If all translations starts in same time, all will test is amount ($500) available ? which will true and next statement will transfer funds to other account.
I have read about Transaction isolation levels but I couldn’t decide which isolation level I should use, actually I am confuse in its understanding. Please help me.
Thanks
The aim is to prevent another process reading the balance but minimise blocking for other users. So use the “table as a queue” type locks thus:
The alternative is to do it in one, which is more feasible if there is one table involved.
The CROSS JOIN is a test to