I have this TABLE_A:
| id | columnA | columnB |
|---|---|---|
| 1 | oldValueA | oldValueB |
When two queries are performed at the exact same time and concurrency issues arise:
Query #1:
UPDATE TABLE_A
SET columnA = 'newValueA', columnB = 'newValueB'
WHERE id = 1;
Query #2:
SELECT columnA, columnB
FROM TABLE_A
WHERE id = 1 WITH UR;
Is there a chance that the SELECT query will return mixed old/new values this one particular row like:
newValueA, oldValueB
Is the UPDATE query always atomic and there is no chance that SELECT with "Read Uncommitted" isolation level can fetch inconsistent column values in a scope of a particular row or the update can happen per column and the SELECT query can return when the other column is not yet updated? Does it depend on the database?
My question is related mostly to Db2 database.
newValueA, oldValueBBUT if within your application you have independent updates on each of those columns in separate transactions THAT could generate such scenario.