Skip to content

Commit

Permalink
doctrine#6167 doctrine#6168 - clarifying on the reasoning why query
Browse files Browse the repository at this point in the history
… is used instead of `fetchColumn`

(cherry picked from commit d2be4a2)
  • Loading branch information
Ocramius authored and Alexey Snigirev committed Nov 27, 2017
1 parent de4b40b commit 7ea97e6
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);

// Use query to force master in MasterSlaveConnection
// Using `query` to force usage of the master server in MasterSlaveConnection
$this->_nextValue = (int) $conn->query($sql)->fetchColumn();
$this->_maxValue = $this->_nextValue + $this->_allocationSize;
}
Expand Down

0 comments on commit 7ea97e6

Please sign in to comment.