Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

How is the best isolation level for the problem (no replies)

$
0
0
Hello guys, are you ok?

Well, i'm having a little doubt about a isolation level of a transaction.
I have a group of query that will be executed and perform the follow actions:

- 1º step: check if the user account have founds (SELECT);
- 2º step: (here, some updates in another table and bla bla bla);
- 3º step: disccount the ammount (if his account have founds) of the user account;

The problem is: if two transaction were executed in the same time (on the truth, with miliseconds of diference, anyway, SIMULTANEOUS!), the 1º step and 3º step can be a big problem for the database. Let's call the transactions by T1 and T2. If T1 execute the 1º step, and T2 execute the 1º step BEFORE T1 execute the 3º step, T2 can receive the response that have founds in the account, even if the T1 in the 3º step, erase all this founds.

So i need a isolation level for the transaction that make the T2 (or T3, T4, Tn) wait for a complete execution of T1 for continue.

So well, what is the best choice for my problem friends?
Best regards,
Luiz Cláudio Pinheiro

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>