改名
This commit is contained in:
@@ -42,6 +42,8 @@ class Command extends Component
|
||||
/** @var string */
|
||||
private string $_modelName;
|
||||
|
||||
public string $dbname = '';
|
||||
|
||||
private ?PDOStatement $prepare = null;
|
||||
|
||||
|
||||
@@ -130,9 +132,7 @@ class Command extends Component
|
||||
if (microtime(true) - $time >= 0.02) {
|
||||
$this->warning('Mysql:' . Json::encode([$this->sql, $this->params]) . (microtime(true) - $time));
|
||||
}
|
||||
if ($this->prepare) {
|
||||
$this->prepare->closeCursor();
|
||||
}
|
||||
$this->prepare?->closeCursor();
|
||||
return $result;
|
||||
} catch (\Throwable $exception) {
|
||||
return $this->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql');
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user