Skip to content

Instantly share code, notes, and snippets.

@xboston
Created February 17, 2016 09:09
Show Gist options
  • Save xboston/05c6335759fefcf65bcd to your computer and use it in GitHub Desktop.
Save xboston/05c6335759fefcf65bcd to your computer and use it in GitHub Desktop.
<?php
namespace Models\Traits {
trait Isolation
{
/**
* Поиск записей в изоляционной транзакции
*
* @param null $parameters
* @return mixed
*/
public function findIsolation($parameters = null){
$this->getDi()->get('db')->query("SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED");
$data = $this->find($parameters);
$this->getDi()->get('db')->query("SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ");
return $data;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment