Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1186

Proxy Objects are incompatible with Serialization

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      Lazy-loading users is impossible atm if you want to serialize them at some point, and they are using private member variables.

      My suggestion is to check whether the proxied class implements the Serializable interface, and in these cases instead of implementing a __sleep method, a serialize/unserialize method should be implemented instead.

      Something like:

      public function serialize()

      { return serialize(array($this->__isInitialized__, parent::serialize())); }

      public function unserialize($str)

      { list($this->__initialized__, $parentStr) = unserialize($str); parent::unserialize($parentStr); }

      At the moment, this makes Doctrine Proxy objects incompatible with the Symfony Security component, and if possible it should be fixed for the 2.1 release. If you need help on this, let me know.

        Activity

        Johannes Schmitt created issue -
        Hide
        Johannes Schmitt added a comment -

        Closing this, not sure what I was debugging there, the problem is a Symfony one

        Show
        Johannes Schmitt added a comment - Closing this, not sure what I was debugging there, the problem is a Symfony one
        Johannes Schmitt made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12686 ] jira-feedback [ 14886 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14886 ] jira-feedback2 [ 16750 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16750 ] jira-feedback3 [ 19003 ]

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

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Johannes Schmitt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: