diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 685fc0d71d7..eadb1f14779 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -348,9 +348,14 @@ public function createQueryBuilder() * * @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that * makes use of optimistic locking fails. + * + * @throws Exception */ public function flush($entity = null) { + if (!is_null($entity)) + throw new Exception('You shall not use single entity flush!'); + $this->errorIfClosed(); $this->unitOfWork->commit($entity);