Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-1210

if I call computeAssociationChanges twice it will add this collection twice

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 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

        realmfoo Konstantin created issue -
        Hide
        beberlei Benjamin Eberlei added a comment -

        The API is marked as internal.

        Show
        beberlei Benjamin Eberlei added a comment - The API is marked as internal.
        beberlei Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Hide
        realmfoo 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
        realmfoo 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
        realmfoo 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
        realmfoo 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).
        realmfoo Konstantin made changes -
        Resolution Invalid [ 6 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        beberlei 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
        beberlei 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.
        beberlei Benjamin Eberlei made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira [ 12717 ] jira-feedback [ 14904 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14904 ] jira-feedback2 [ 16768 ]
        beberlei 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={expand=changesets[0:20].revisions[0:29],reviews, query=DDC-1210}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: