Skip to content

Commit 2fcfbd1

Browse files
committed
only change rollback state if it is not finished
1 parent 2bf2062 commit 2fcfbd1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Http/HttpUnmanagedTransaction.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,14 @@ public function isFinished(): bool
167167
*/
168168
private function handleNeo4jException(Neo4jException $e): void
169169
{
170-
$classifications = array_map(static fn (Neo4jError $e) => $e->getClassification(), $e->getErrors());
171-
$classifications = array_unique($classifications);
172-
173-
$intersection = array_intersect($classifications, TransactionHelper::ROLLBACK_CLASSIFICATIONS);
174-
if ($intersection !== []) {
175-
$this->isRolledBack = true;
170+
if (!$this->isFinished()) {
171+
$classifications = array_map(static fn (Neo4jError $e) => $e->getClassification(), $e->getErrors());
172+
$classifications = array_unique($classifications);
173+
174+
$intersection = array_intersect($classifications, TransactionHelper::ROLLBACK_CLASSIFICATIONS);
175+
if ($intersection !== []) {
176+
$this->isRolledBack = true;
177+
}
176178
}
177179

178180
throw $e;

0 commit comments

Comments
 (0)