symfony2 / doctrine2 flush createas a select after delete
I'm removing an entity with these commands:

    $this->getEntityManager()->remove($exclusivedeal->getPicture());
    $exclusivedeal->setPicture();
    $this->getEntityManager()->flush();
    $this->getEntityManager()->getConnection()->commit();


The picture Attribute is a ManyToOne relation to the picture entity.
The picture Entity has a function that is called via the postremove Annotation to remove the picture physically from the filesystem. The Flush() operation is doing the sql statements. After the delete Statement, an select statement is called too. This creates the following error:

    [2012-06-07 10:06:46] request.CRITICAL: Doctrine\ORM\EntityNotFoundException: Entity was not found. (uncaught exception) at C:\xampp\htdocs\forum\app\cache\dev\doctrine\orm\Proxies\__CG__DankeForumBundleEntityPicture.php line 32 [] []

When i change the annotation to preRemove, everything is fine, but this can't be the solution. I'm doing the same operation on an other Entity with a relation to the Picture Entity.

When i set the cascade remove annotation, the same problem is happened.

Has anyone an idea what i'm doing wrong?

Thank you very much.

symfony2 / doctrine2 flush createas a select after delete
===

I'm removing an entity with these commands:

    $this->getEntityManager()->remove($exclusivedeal->getPicture());
    $exclusivedeal->setPicture();
    $this->getEntityManager()->flush();
    $this->getEntityManager()->getConnection()->commit();


The picture Attribute is a ManyToOne relation to the picture entity.
The picture Entity has a function that is called via the postremove Annotation to remove the picture physically from the filesystem. The Flush() operation is doing the sql statements. After the delete Statement, an select statement is called too. This creates the following error:

    [2012-06-07 10:06:46] request.CRITICAL: Doctrine\ORM\EntityNotFoundException: Entity was not found. (uncaught exception) at C:\xampp\htdocs\forum\app\cache\dev\doctrine\orm\Proxies\__CG__DankeForumBundleEntityPicture.php line 32 [] []

When i change the annotation to preRemove, everything is fine, but this can't be the solution. I'm doing the same operation on an other Entity with a relation to the Picture Entity.

When i set the cascade remove annotation, the same problem is happened.

Has anyone an idea what i'm doing wrong?

Thank you very much.
