Merge remote-tracking branch 'origin/support/3.2' into develop

This commit is contained in:
lenaick.moreira
2026-03-02 10:56:31 +01:00
123 changed files with 2898 additions and 2149 deletions

View File

@@ -32,6 +32,8 @@ class DoctrineDbalAdapter extends AbstractAdapter implements PruneableInterface
{
private const MAX_KEY_LENGTH = 255;
private static int $savepointCounter = 0;
private MarshallerInterface $marshaller;
private Connection $conn;
private string $platformName;
@@ -244,6 +246,26 @@ class DoctrineDbalAdapter extends AbstractAdapter implements PruneableInterface
return $failed;
}
if ($this->conn->isTransactionActive() && $this->conn->getDatabasePlatform()->supportsSavepoints()) {
$savepoint = 'cache_save_'.++self::$savepointCounter;
try {
$this->conn->createSavepoint($savepoint);
$failed = $this->doSaveInner($values, $lifetime, $failed);
$this->conn->releaseSavepoint($savepoint);
return $failed;
} catch (\Throwable $e) {
$this->conn->rollbackSavepoint($savepoint);
throw $e;
}
}
return $this->doSaveInner($values, $lifetime, $failed);
}
private function doSaveInner(array $values, int $lifetime, array $failed): array|bool
{
$platformName = $this->getPlatformName();
$insertSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (?, ?, ?, ?)";