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