This commit is contained in:
2021-08-01 19:04:34 +08:00
parent 822f7a7f36
commit b71b45c5c8
5 changed files with 442 additions and 419 deletions
+2 -6
View File
@@ -42,9 +42,6 @@ class Connection extends Component
public int $timeout = 1900;
public int $maxNumber = 30;
public int $minNumber = 10;
/**
* @var bool
* enable database cache
@@ -85,9 +82,8 @@ class Connection extends Component
return;
}
$this->beginTransaction();
Event::on(Connection::TRANSACTION_COMMIT, [$this, 'commit'], false, true);
Event::on(Connection::TRANSACTION_ROLLBACK, [$this, 'rollback'], false, true);
Event::on(Connection::TRANSACTION_ROLLBACK, [$this, 'rollback'], [], true);
Event::on(Connection::TRANSACTION_COMMIT, [$this, 'commit'], [], true);
}
/**