From a7ab2cdbc59320c7c5b27791e58974327eb994ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= Date: Thu, 4 Jul 2024 14:35:04 +0200 Subject: [PATCH] Use Exception::getCode() to find SQL error state --- .../Classes/Infrastructure/DbalCheckpointStorage.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php index 8cdba5c5e8c..8551d5febb8 100644 --- a/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php +++ b/Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php @@ -11,7 +11,6 @@ use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; -use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; @@ -94,7 +93,7 @@ public function acquireLock(): SequenceNumber ]); } catch (DBALException $exception) { $this->connection->rollBack(); - if ($exception instanceof LockWaitTimeoutException) { + if ($exception instanceof LockWaitTimeoutException || ($exception instanceof DBALDriverException && ($exception->getCode() === 3572 || $exception->getCode() === 7))) { throw new \RuntimeException(sprintf('Failed to acquire checkpoint lock for subscriber "%s" because it is acquired already', $this->subscriberId), 1652279016); } throw new \RuntimeException($exception->getMessage(), 1544207778, $exception);