Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-11-30 · container image gvenzl/oracle-free:23-slim
With SET TRANSACTION ISOLATION LEVEL SERIALIZABLE, a transaction sees the data as of its start. If it then updates a row that another session has changed and committed in the meantime, Oracle refuses with ORA-08177 instead of overwriting that change.
The failed statement does nothing; the transaction must be rolled back and run again. Both cases below were reproduced with two real sessions on Oracle AI Database 26ai Free.
01The row was changed and committed after the transaction read it
Session A starts a serializable transaction and reads balance 1000. Session B sets the balance to 900 and commits. When A updates the same row, it gets ORA-08177 because its snapshot (1000) is out of date.
Setup
CREATE TABLE accounts (account_id NUMBER PRIMARY KEY, balance NUMBER);
INSERT INTO accounts VALUES (1, 1000);
COMMIT;Table created.
1 row created.
Commit complete.SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT balance FROM accounts WHERE account_id = 1;Transaction set.
BALANCE
----------
1000
1 row selected.UPDATE accounts SET balance = 900 WHERE account_id = 1;
COMMIT;1 row updated.
Commit complete.UPDATE accounts SET balance = balance + 50 WHERE account_id = 1;UPDATE accounts SET balance = balance + 50 WHERE account_id = 1
*
ERROR at line 1:
ORA-08177: can't serialize access for this transaction
Help: https://docs.oracle.com/error-help/db/ora-08177/ROLLBACK;Rollback complete.Catch ORA-08177, ROLLBACK, and run the whole transaction again. The new transaction reads 900, adds 50 and commits; the final balance is 950, so B's change is kept.
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT balance FROM accounts WHERE account_id = 1;Transaction set.
BALANCE
----------
900
1 row selected.UPDATE accounts SET balance = 900 WHERE account_id = 1;
COMMIT;1 row updated.
Commit complete.ROLLBACK;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT balance FROM accounts WHERE account_id = 1;
UPDATE accounts SET balance = balance + 50 WHERE account_id = 1;
COMMIT;Rollback complete.
Transaction set.
BALANCE
----------
900
1 row selected.
1 row updated.
Commit complete.SELECT account_id, balance FROM accounts;ACCOUNT_ID BALANCE
---------- ----------
1 950
1 row selected.02The update waited for another session's lock, which then committed
Session A is serializable. Session B updates the row without committing, so A's UPDATE waits. As soon as B commits, A's UPDATE fails with ORA-08177 — the wait ends in an error, not in success.
Setup
CREATE TABLE accounts (account_id NUMBER PRIMARY KEY, balance NUMBER);
INSERT INTO accounts VALUES (1, 1000);
COMMIT;Table created.
1 row created.
Commit complete.SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;Transaction set.UPDATE accounts SET balance = 900 WHERE account_id = 1;1 row updated.UPDATE accounts SET balance = balance + 50 WHERE account_id = 1;COMMIT;Commit complete.UPDATE accounts SET balance = balance + 50 WHERE account_id = 1
*
ERROR at line 1:
ORA-08177: can't serialize access for this transaction
Help: https://docs.oracle.com/error-help/db/ora-08177/ROLLBACK;Rollback complete.If the transaction does not need serializable reads, use the default READ COMMITTED. Then A's UPDATE waits for B, continues after B's commit (1 row updated.), and the balance becomes 950.
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;Transaction set.UPDATE accounts SET balance = 900 WHERE account_id = 1;1 row updated.UPDATE accounts SET balance = balance + 50 WHERE account_id = 1;COMMIT;Commit complete.1 row updated.COMMIT;Commit complete.SELECT account_id, balance FROM accounts;ACCOUNT_ID BALANCE
---------- ----------
1 950
1 row selected.FAQ
What does ORA-08177 can't serialize access for this transaction mean?
Your SERIALIZABLE transaction tried to change a row that another transaction changed and committed after yours started. Oracle stops it so the other change is not lost.
How do I fix ORA-08177?
Roll back and retry the transaction, or use READ COMMITTED if serializable isolation is not required. Both are shown above with real session output.
Why do I get ORA-08177 after waiting on a lock?
In serializable mode, when the session holding the lock commits a change to that row, the waiting UPDATE fails with ORA-08177. In the test it waited, then failed right after the other session's COMMIT.
Is ORA-08177 the same as a deadlock (ORA-00060)?
No. ORA-00060 is two sessions waiting on each other. ORA-08177 is a serializable transaction that would overwrite a newer committed change.
How we verify
Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.
lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0