public function setTransactionIsolationLevel($level)
{
switch ($level) {
case Transaction::SERIALIZABLE:
$this->db->createCommand('PRAGMA read_uncommitted = False;')->execute();
break;
case Transaction::READ_UNCOMMITTED:
$this->db->createCommand('PRAGMA read_uncommitted = True;')->execute();
break;
default:
throw new NotSupportedException(get_class($this) . ' only supports transaction isolation levels READ UNCOMMITTED and SERIALIZABLE.');
}
}