Reputation: 14439
Does following update query always leave table data unchanged?
update mytable set column1 = column1
Wonder if there will be lost updates?
Initially column1
has value oldValue
. There are two transactions (t1 and t2) and t2 starts in the middle of t1.
t1: update mytable set column1 = 'newValue'
and
t2: update mytable set column1 = column1
as t2 transaction started later than t1 it also finished later than t1.
The question: what value will be assigned to the column1
?
Upvotes: 0
Views: 220
Reputation: 7282
Transaction isolation level is what to isolate different transactions, and if you use read committed or higher isolation levels, there won't be any problem.
By the way as far as I know your first query never updates any record in Oracle, even with "read uncommitted" isolation level.
Upvotes: 1