public void setTransactionIsolation ( final int level ) throws SQLException { cmdPrologue ( ) ; lock . lock ( ) ; try { String query = "SET SESSION TRANSACTION ISOLATION LEVEL" ; switch ( level ) { case Connection . TRANSACTION_READ_UNCOMMITTED : query += " READ UNCOMMITTED" ; break ; case Connection . TRANSACTION_READ_COMMITTED : query += " READ COMMITTED" ; break ; case Connection . TRANSACTION_REPEATABLE_READ : query += " REPEATABLE READ" ; break ; case Connection . TRANSACTION_SERIALIZABLE : query += " SERIALIZABLE" ; break ; default : throw new SQLException ( "Unsupported transaction isolation level" ) ; } executeQuery ( query ) ; transactionIsolationLevel = level ; } finally { lock . unlock ( ) ; } }
Set transaction isolation .