-1

Is this right way to do READ UNCOMMITTED?

$cars = Cars
        ::raw('SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;')
        ->Active()->get();
Pankaj
  • 9,749
  • 32
  • 139
  • 283
  • Have you run it? did you get any errors? If you want to check whether it did something: maybe interesting? : [View isolation level for a query in mysql](http://stackoverflow.com/questions/5347567/view-isolation-level-for-a-query-in-mysql) – Ryan Vincent Dec 03 '15 at 03:33
  • have you solved your problem maybe? How did you do it? – boroboris Sep 08 '16 at 20:37

2 Answers2

-1

You should use:

Cars::raw('SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED');

and than

$cars = Cars::all();

to get all cars for example.

boroboris
  • 1,548
  • 1
  • 19
  • 32
-7

You should never use READ UNCOMMITTED unless you are generating random number and dont care about the data returned.

skyde
  • 2,816
  • 4
  • 34
  • 53
  • this is counter productive and question asks oposite thing. – boroboris Sep 09 '16 at 10:54
  • The question is similar to "Is this right way to dereference uninitialized pointer?" It's important to first understand that this is almost never what you really want to do. – skyde Sep 22 '16 at 18:14