File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/Illuminate/Database/Connectors Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ public function connect(array $config)
33
33
$ this ->getDsn ($ config ), $ config , $ this ->getOptions ($ config )
34
34
);
35
35
36
+ $ this ->configureIsolationLevel ($ connection , $ config );
37
+
36
38
$ this ->configureEncoding ($ connection , $ config );
37
39
38
40
// Next, we will check to see if a timezone has been specified in this config
@@ -52,6 +54,20 @@ public function connect(array $config)
52
54
return $ connection ;
53
55
}
54
56
57
+ /**
58
+ * Set the connection transaction isolation level.
59
+ *
60
+ * @param \PDO $connection
61
+ * @param array $config
62
+ * @return void
63
+ */
64
+ protected function configureIsolationLevel ($ connection , array $ config )
65
+ {
66
+ if (isset ($ config ['isolation_level ' ])) {
67
+ $ connection ->prepare ("set session characteristics as transaction isolation level {$ config ['isolation_level ' ]}" )->execute ();
68
+ }
69
+ }
70
+
55
71
/**
56
72
* Set the connection character set and collation.
57
73
*
You can’t perform that action at this time.
0 commit comments