Unanswered: Updating a single row by one user, transactions
I'm trying change a field value of a table to indicate that only one user has been updated a row. After set a value of this field in a single row another user cannot to do the same operation. How can i check if only a user has been updated this row ?
At moment I'm starting a transaction and doing it:
SELECT INCFLAG FROM NEW TABLE(
INCFLAG = INCFLAG+1,
USERSET = USERNAME
MYTABLE.INCFLAG = 0
After I will check if INCFLAG > 1.
If INCFLAG > 1 then rollback transaction else I'm commit.
To get the user of operation I'm using the USERSET field.
What I'm doing is correct? I'm using "read commited" isolation.
From your update statement ,i cant see any possiblility that incflag will > 1。
because of the predicate MYTABLE.INCFLAG = 0。
by the way，as for as i kown db2 for luw has no isolation level called "read commited"?
There are "RR, RS,CS,UR"。
Maybe it is the isolation level of oracle。