modify
This commit is contained in:
@@ -50,7 +50,7 @@ class Connection extends Component
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$connection = Context::getContext($coroutineName);
|
$connection = Context::getContext($coroutineName);
|
||||||
if (!$connection->inTransaction()) {
|
if (!$connection?->inTransaction()) {
|
||||||
$connection->beginTransaction();
|
$connection->beginTransaction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ class Connection extends Component
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$connection = Context::getContext($coroutineName);
|
$connection = Context::getContext($coroutineName);
|
||||||
if ($connection->inTransaction()) {
|
if ($connection?->inTransaction()) {
|
||||||
$connection->commit();
|
$connection->commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ class Connection extends Component
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (($connection = Context::getContext($coroutineName)) instanceof PDO) {
|
if (($connection = Context::getContext($coroutineName)) instanceof PDO) {
|
||||||
if ($connection->inTransaction()) {
|
if ($connection?->inTransaction()) {
|
||||||
$connection->rollBack();
|
$connection->rollBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user