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

Unserialized non-initialized proxy classes should throw an exception when a method is called


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


      When we serialize entities in a session, we often have pointers to uninitialized proxies.
      These proxies have $_entityPersister == null.

      The problem is that if you happen to call by mistake a method on such a proxy, you're not aware that this is an uninitialized proxy, and the business methods are called, with null values for every property.

      I think the proxy should throw an exception in that case.
      Attached, a patch with the proposed modification.


        benjamin Benjamin Morel created issue -
        beberlei Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 13568 ] jira-feedback [ 14039 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14039 ] jira-feedback2 [ 15903 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15903 ] jira-feedback3 [ 18158 ]

        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-1732}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            beberlei Benjamin Eberlei
            benjamin Benjamin Morel
          • Votes:
            0 Vote for this issue
            2 Start watching this issue


            • Created: