Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1210

if I call computeAssociationChanges twice it will add this collection twice

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: Git Master
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      For example, if I call computeChangeSets() by myself before calling flush() it will result in errors.

        Activity

        Konstantin created issue -
        Hide
        Benjamin Eberlei added a comment -

        The API is marked as internal.

        Show
        Benjamin Eberlei added a comment - The API is marked as internal.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Hide
        Konstantin added a comment -

        Method computeChangeSets is not marked as internal (https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L500).

        If it is then how can I find out was entity changed or not? I need to know it before making other changes (update time, updater name and etc.).

        Show
        Konstantin added a comment - Method computeChangeSets is not marked as internal ( https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L500 ). If it is then how can I find out was entity changed or not? I need to know it before making other changes (update time, updater name and etc.).
        Hide
        Konstantin added a comment -

        Another example of using computeAssociationChanges via computeChangeSet described here:
        http://www.doctrine-project.org/docs/orm/2.0/en/reference/events.html

        So I can't use this example because of the problem with collections. onFlush rises AFTER computeChangeSets and BEFORE any changes, so if I call computeChangeSets inside onFlush event it will break commit (twice insert of equal index).

        Show
        Konstantin added a comment - Another example of using computeAssociationChanges via computeChangeSet described here: http://www.doctrine-project.org/docs/orm/2.0/en/reference/events.html So I can't use this example because of the problem with collections. onFlush rises AFTER computeChangeSets and BEFORE any changes, so if I call computeChangeSets inside onFlush event it will break commit (twice insert of equal index).
        Konstantin made changes -
        Resolution Invalid [ 6 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Benjamin Eberlei added a comment -

        The documentation was a bit unclear about this.

        The computeChangeSet API is internal. Its only allowed to be called for new entities after they have been persisted inside the onFlush.

        You can use "getEntityChangeSet()" inside preUpdate for example to get all the changes that are done.

        Show
        Benjamin Eberlei added a comment - The documentation was a bit unclear about this. The computeChangeSet API is internal. Its only allowed to be called for new entities after they have been persisted inside the onFlush. You can use "getEntityChangeSet()" inside preUpdate for example to get all the changes that are done.
        Benjamin Eberlei made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12717 ] jira-feedback [ 14904 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14904 ] jira-feedback2 [ 16768 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16768 ] jira-feedback3 [ 19021 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1210, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Konstantin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: