问题
I've always considered that there were no isolation within a single transaction.
For example if I have 2 methods M1 and M2, M1 update X in database and M2 select X or a set containing X. If both method belongs to the same transaction and M2 is executed after M1:
- Does M2 always seen M1 update whatever the type of operation, the RDBMS or the isolation level is ?
- If no, can someone explain in details the different possible behavior according to associated criteria
回答1:
In the situation described, M2 will always see M1's changes yes. An isolation level of READ COMMITTED, for example, only applies to other transactions, not the transaction supplying it.
Cheers -
来源:https://stackoverflow.com/questions/20948872/isolation-within-the-same-transaction