简体   繁体   中英

ORA-08177: can't serialize access for this transaction - Oracle 11g

I am using ADOdb Library for a PHP application.

This application works smoothly with Oracle 9g, but when we transferred it to a new server it often throws the following error:

ORA-08177: can't serialize access for this transaction

Is it maybe a problem with oci_8.dll I am using? Should I update it to php_oci8_11g.dll?

This error would occur if your isolation level was set to serializable and you were doing DML on tables that other were also doing DML on.

Are you setting such an isolation level + doing DML, and if so why isn't the standard read committed ok for you?

for example:

someone removes a row

ANOTHER SESSION                   YOUR SESSION

SQL> delete from a where id = 1;

1 row deleted.

commit not done yet..meanwhile, your SERIALIZED transaction tries to remove the same row...

SQL> alter session set isolation_level=serializable;

Session altered.

SQL> delete from a where id = 1;

your session will hang at this point as the other session has the lock. if that other session now commits:

SQL> commit;        

Commit complete.  

your session hits that error:

delete from a where id = 1
*
ERROR at line 1:
ORA-08177: can't serialize access for this transaction

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM