yii\db\Transaction::setIsolationLevel PHP Method

setIsolationLevel() public method

This method can be used to set the isolation level while the transaction is already active. However this is not supported by all DBMS so you might rather specify the isolation level directly when calling Transaction::begin.
See also: http://en.wikipedia.org/wiki/Isolation_%28database_systems%29#Isolation_levels
public setIsolationLevel ( string $level )
$level string The transaction isolation level to use for this transaction. This can be one of [[READ_UNCOMMITTED]], [[READ_COMMITTED]], [[REPEATABLE_READ]] and [[SERIALIZABLE]] but also a string containing DBMS specific syntax to be used after `SET TRANSACTION ISOLATION LEVEL`.
    public function setIsolationLevel($level)
    {
        if (!$this->getIsActive()) {
            throw new Exception('Failed to set isolation level: transaction was inactive.');
        }
        Yii::trace('Setting transaction isolation level to ' . $level, __METHOD__);
        $this->db->getSchema()->setTransactionIsolationLevel($level);
    }