Oracle JDBC Driver支持的事务隔离级别设置
For transactions, the Oracle server supports only the TRANSACTION_READ_COMMITTED and TRANSACTION_SERIALIZABLE transaction isolation levels. The default is TRANSACTION_READ_COMMITTED. Use the following methods of the oracle.jdbc.OracleConnection interface to get and set the level:
getTransactionIsolation(): Gets this connection's current transaction isolation level. setTransactionIsolation(): Changes the transaction isolation level,So with Oracle JDBC driver the possible transaction isolation levels are TRANSACTION_READ_COMMITED and the TRANSACTION_SERIALIZABLE. Trying to set any other transaction isolation level will cast the following exception: "EXCEPTIONS : Code 17030 SQL State null Message READ_COMMITTED and SERIALIZABLE are the only valid transaction levels".
查看oracle数据库session事务设置的是哪个隔离级别
connect system/manager SQL> update scott.emp set empno=7369 where empno=7369; 1 row updated. SQL> select decode(bitand(flag,268435456),268435456,'serializable','non-serializable') from v$transaction,v$session where taddr=addr and sid=(select sid from v$mystat where rownum <2); DECODE(BITAND(FL ---------------- non-serializable SQL> rollback; Rollback complete. SQL> set transaction isolation level serializable; Transaction set. SQL> update scott.emp set empno=7369 where empno=7369; 1 row updated. SQL> select decode(bitand(flag,268435456),268435456,'serializable','non-serializable') from v$transaction,v$session where taddr=addr and sid=(select sid from v$mystat where rownum <2); DECODE(BITAND(FL ---------------- serializable
