qqq
This commit is contained in:
+4
-3
@@ -187,15 +187,16 @@ class Command extends Component
|
|||||||
$result = $client->lastInsertId();
|
$result = $client->lastInsertId();
|
||||||
$prepare->closeCursor();
|
$prepare->closeCursor();
|
||||||
|
|
||||||
if (!$client->inTransaction()) {
|
|
||||||
$this->connection->release($client);
|
|
||||||
}
|
|
||||||
return $result == 0 ? true : (int)$result;
|
return $result == 0 ? true : (int)$result;
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
if ($this->canReconnect($throwable->getMessage())) {
|
if ($this->canReconnect($throwable->getMessage())) {
|
||||||
return $this->_execute();
|
return $this->_execute();
|
||||||
}
|
}
|
||||||
return $this->error($throwable);
|
return $this->error($throwable);
|
||||||
|
} finally {
|
||||||
|
if (isset($client) && !$client->inTransaction()) {
|
||||||
|
$this->connection->release($client);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user