Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-3079

preUpdate in EntityListener not run in transaction

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      I have entity:

      class Article{
      	/**
      	 * @ORM\OneToMany(targetEntity = "ArticleModule\Model\Entities\ArticlePhoto", mappedBy = "article", cascade = {"persist", "remove"}, orphanRemoval = TRUE)
      	 * @ORM\OrderBy({"sequence" = "ASC"})
      	 */
      	protected $articlePhotos;
      }
      

      And Entity Listener with preRemove.

      I call

      $article->articlePhotos->clear();
      ...some changes with entity...
      $em->flush();
      

      preRemove in Entity Listener is called, BUT before Begin transaction...

      I can do
      $em->transactional(function(){}); then it's full in transaction..

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Jiri Napravnik
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: