Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-415

Introduce UnitOfWork Stages and throw exceptions for wrong method uses

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0-ALPHA4
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      Currently the event architecture is fragile when used wrong. I already see lots of "bug reports" popping up on this issue due to people dont understanding what is doable and what is not.

      How about we introduce an instance variable stage into the UnitOfWork and introduce an assertIsInStages($stages) protected method which is called ineach major command method of the UnitOfWork to verify its applied correctly?

      Stages could be:

      UNFLUSHED
      PRE_COMPUTE_CHANGESETS
      POST_COMPUTE_CHANGESETS
      FLUSH_LOOP
      TRANSACTION_COMPLETED

        Activity

        Benjamin Eberlei created issue -
        Hide
        Roman S. Borschel added a comment - - edited

        I'm not sure. I'm afraid this will just add code bloat with the only goal to provide better error messages and its fragile to do right. There will surely be places missed in the code where to check for the stage and it might even constrain some valid use-cases we dont think of yet.

        So I'm afraid that this would hurt more than it would help.

        Show
        Roman S. Borschel added a comment - - edited I'm not sure. I'm afraid this will just add code bloat with the only goal to provide better error messages and its fragile to do right. There will surely be places missed in the code where to check for the stage and it might even constrain some valid use-cases we dont think of yet. So I'm afraid that this would hurt more than it would help.
        Roman S. Borschel made changes -
        Field Original Value New Value
        Priority Major [ 3 ] Minor [ 4 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 11039 ] jira-feedback [ 13844 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13844 ] jira-feedback2 [ 15708 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15708 ] jira-feedback3 [ 17965 ]

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

          People

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

            Dates

            • Created:
              Updated: