Question

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
Was it helpful?

Solution

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 -

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top