Skip to content

Commit

Permalink
Fix doctrine#6167: Force use of master replica for sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Protko committed Mar 13, 2017
1 parent e6c4341 commit 1e7444d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Id/SequenceGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function generate(EntityManager $em, $entity)
$conn = $em->getConnection();
$sql = $conn->getDatabasePlatform()->getSequenceNextValSQL($this->_sequenceName);

$this->_nextValue = (int)$conn->fetchColumn($sql);
$this->_nextValue = (int) $conn->query($sql)->fetchColumn();
$this->_maxValue = $this->_nextValue + $this->_allocationSize;
}

Expand Down

0 comments on commit 1e7444d

Please sign in to comment.