Skip to content

Commit

Permalink
OCI8 requires locks to be within a transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
carnage committed Oct 10, 2020
1 parent 44ca802 commit b72edc6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Functional/Query/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ public function testReadLock(): void
->where($sut->expr()->eq('lt.data', '?'))
->setParameter(0, 'foo', ParameterType::STRING);

$this->connection->beginTransaction();

$result = $query->execute();
$record = $result->fetchAllAssociative();
self::assertEquals(1, $record[0]['primary_key']);

$this->connection->rollBack();
}

public function testWriteLock(): void
Expand All @@ -69,8 +73,12 @@ public function testWriteLock(): void
->where($sut->expr()->eq('lt.data', '?'))
->setParameter(0, 'bar', ParameterType::STRING);

$this->connection->beginTransaction();

$result = $query->execute();
$record = $result->fetchAllAssociative();
self::assertEquals(2, $record[0]['primary_key']);

$this->connection->rollBack();
}
}

0 comments on commit b72edc6

Please sign in to comment.