改名
This commit is contained in:
@@ -46,9 +46,6 @@ class Connection extends Component
|
|||||||
if (!Context::hasContext('begin_' . $coroutineName)) {
|
if (!Context::hasContext('begin_' . $coroutineName)) {
|
||||||
Context::setContext('begin_' . $coroutineName, 0);
|
Context::setContext('begin_' . $coroutineName, 0);
|
||||||
}
|
}
|
||||||
if (Context::increment('begin_' . $coroutineName) != 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$connection = Context::getContext($coroutineName);
|
$connection = Context::getContext($coroutineName);
|
||||||
if ($connection instanceof PDO && !$connection->inTransaction()) {
|
if ($connection instanceof PDO && !$connection->inTransaction()) {
|
||||||
$connection->beginTransaction();
|
$connection->beginTransaction();
|
||||||
@@ -104,8 +101,8 @@ class Connection extends Component
|
|||||||
}
|
}
|
||||||
/** @var PDO $connections */
|
/** @var PDO $connections */
|
||||||
$connections = $this->getPool()->get($coroutineName, $this->create($coroutineName, $config));
|
$connections = $this->getPool()->get($coroutineName, $this->create($coroutineName, $config));
|
||||||
if ($number = Context::getContext('begin_' . $coroutineName)) {
|
if (Context::hasContext('begin_' . $coroutineName)) {
|
||||||
$number > 0 && $connections->beginTransaction();
|
$connections->beginTransaction();
|
||||||
}
|
}
|
||||||
return Context::setContext($coroutineName, $connections);
|
return Context::setContext($coroutineName, $connections);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user