Skip to content

Commit 2663dc5

Browse files
committed
only change rollback state if it is not finished
1 parent 9f0b59b commit 2663dc5

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/Bolt/BoltUnmanagedTransaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function __destruct()
173173
private function handleMessageException(MessageException $e): void
174174
{
175175
$exception = Neo4jException::fromMessageException($e);
176-
if (in_array($exception->getClassification(), TransactionHelper::ROLLBACK_CLASSIFICATIONS)) {
176+
if (!$this->isFinished() && in_array($exception->getClassification(), TransactionHelper::ROLLBACK_CLASSIFICATIONS)) {
177177
$this->isRolledBack = true;
178178
}
179179
throw $exception;

tests/Integration/TransactionIntegrationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ public function testCommitInvalid(string $alias): void
305305
self::assertFalse($tsx->isRolledBack());
306306
self::assertTrue($tsx->isCommitted());
307307

308-
$this->expectException(Neo4jException::class);
309308
$exception = false;
310309
try {
311310
$tsx->commit();

0 commit comments

Comments
 (0)