1
0
mirror of synced 2024-12-14 07:06:04 +03:00

Remove call to EntityManager#flush() if the unitofwork contains pending insertions. Flush should always be triggered explicitly.

This commit is contained in:
Benjamin Eberlei 2010-12-11 00:54:54 +01:00
parent 4f154b6aa1
commit 3c0f92f4c7

View File

@ -482,15 +482,6 @@ abstract class AbstractQuery
*/
public function execute($params = array(), $hydrationMode = null)
{
// If there are still pending insertions in the UnitOfWork we need to flush
// in order to guarantee a correct result.
//TODO: Think this over. Its tricky. Not doing this can lead to strange results
// potentially, but doing it could result in endless loops when querying during
// a flush, i.e. inside an event listener.
if ($this->_em->getUnitOfWork()->hasPendingInsertions()) {
$this->_em->flush();
}
if ($hydrationMode !== null) {
$this->setHydrationMode($hydrationMode);
}