Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2715

[GH-807] Fix for OptimisticLockingException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.5, 2.4.1
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of janbster:

      Url: https://github.com/doctrine/doctrine2/pull/807

      Message:

      When using the $em->lock() method with an entity that uses a DateTime field for optimistic locking, and the optimistic locking fails, an OptimisticLockingException is generated Using the static method lockFailedVersionMismatch in OptimisticLockingException. In this case the parameters are of type DateTime. Therefore, the string for the exception message cannot be generated and you will get an error "Object of class DateTime could not be converted to string". I added a conversion to class to solve this problem.

      I also changed the test OptimisticTest to actually test for this problem. If you run the tests without the changed OptimisticLockingException, you will see the error. I also modified the test to ensure that the Exception is actually thrown.

        Activity

        Doctrine Bot created issue -
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-807] was closed:
        https://github.com/doctrine/doctrine2/pull/807

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-807] was closed: https://github.com/doctrine/doctrine2/pull/807
        Hide
        Benjamin Eberlei added a comment -

        Merged into 2.4 and 2.3 branches

        Show
        Benjamin Eberlei added a comment - Merged into 2.4 and 2.3 branches
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3.5 [ 10521 ]
        Fix Version/s 2.4.1 [ 10528 ]
        Resolution Fixed [ 1 ]

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

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: