8.2.41 setTransactionIsolation(int level)
- Organization of this subsection
(1) Function
This method sets the transaction isolation level for this Connection object.
(2) Format
public synchronized void setTransactionIsolation(int level) throws SQLException
(3) Arguments
- int level
-
Specifies the transaction isolation level to be applied. Specify one of the following values:
-
Connection.TRANSACTION_READ_COMMITTED
Specifies that READ COMMITTED is to be applied as the transaction isolation level.
-
Connection.TRANSACTION_REPEATABLE_READ
Specifies that REPEATABLE READ is to be applied as the transaction isolation level.
-
(4) Return value
None.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
The Connection object is closed.
-
A transaction has already started.
-
A ResultSet object created by this Connection object with HOLD_CURSORS_OVER_COMMIT specified for holdability has not been closed.
-
The value specified for the transaction isolation level is neither of the following:
-
Connection.TRANSACTION_READ_COMMITTED
-
Connection.TRANSACTION_REPEATABLE_READ
-
(6) Notes
-
The transaction isolation level is determined in the priority order described below. A smaller number represents a higher priority (for example, 1 has a higher priority than 2).
-
Transaction isolation level specified with the setTransactionIsolation method
-
Transaction isolation level specified in the adb_clt_trn_iso_lv system property
-
adb_clt_trn_iso_lv property value specified in the info argument of the getConnection method of the DriverManager class
-
Value of adb_clt_trn_iso_lv specified in the url argument of the getConnection method of the DriverManager class
-
Transaction isolation level specified in the adb_sys_trn_iso_lv server definition operand
-
-
The transaction isolation level specified with the setTransactionIsolation method is not inherited when the Connection object has been pooled and then reused. In such a case, it remains the same as it was before the setTransactionIsolation method was executed.