Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-678

OneToMany/OneToOne + onDelete=CASCADE may corrupt UoW.

    Details

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

      Description

      OneToMany/OneToOne associations together with an onDelete=CASCADE schema generation hint on the @JoinColumn and appropriate foreign key constraints can potentially result in a corrupt UoW if the associated objects are already managed. We need to add tests for such scenarios and settle on a well-defined behavior in such cases.

        Activity

        Roman S. Borschel created issue -
        Roman S. Borschel made changes -
        Field Original Value New Value
        Description OneToMany/OneToOne associations together with an onDelete=CASCADE schema generation hint and appropriate foreign key constraints can potentially result in a corrupt UoW if the associated objects are already managed. We need to add tests for such scenarios and settle on a well-defined behavior in such cases. OneToMany/OneToOne associations together with an onDelete=CASCADE schema generation hint on the @JoinColumn and appropriate foreign key constraints can potentially result in a corrupt UoW if the associated objects are already managed. We need to add tests for such scenarios and settle on a well-defined behavior in such cases.
        Hide
        Benjamin Eberlei added a comment -

        I think to preserve the semantics the following has to happen:

        "on-delete" => "cascade" has to implicitly set cascade = remove. This hurts performance of course vs just using the on-delete, however it won't corrupt the UoW.

        Show
        Benjamin Eberlei added a comment - I think to preserve the semantics the following has to happen: "on-delete" => "cascade" has to implicitly set cascade = remove. This hurts performance of course vs just using the on-delete, however it won't corrupt the UoW.
        Hide
        Benjamin Eberlei added a comment -

        Not entirely would it hurt performance, you could check if on-delete => cascade is set. If this is the case you wouldnt need to do an explicit remove using the UnitOfWorks cascade.

        Show
        Benjamin Eberlei added a comment - Not entirely would it hurt performance, you could check if on-delete => cascade is set. If this is the case you wouldnt need to do an explicit remove using the UnitOfWorks cascade.
        Hide
        Benjamin Eberlei added a comment -

        Changed to improvement

        Show
        Benjamin Eberlei added a comment - Changed to improvement
        Benjamin Eberlei made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 11606 ] jira-feedback [ 13859 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13859 ] jira-feedback2 [ 15723 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15723 ] jira-feedback3 [ 17980 ]

        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-678, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Roman S. Borschel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: