Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1033

Cloned proxies show unexpected behavior when initialized

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Git Master
    • Fix Version/s: 2.0.2
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      When a proxy has been loaded and is cloned before being initialized, it will behave unexpectedly.

      _load() in the proxy starts a chain of method calls that end up loading the data and putting it into the proxy being in the identity map inside UoW. Now the registered proxy will be updated, but the cloned copy will of course not be changed - except it will behave as if it was initialized. This leads (at least in my case) to changes not being picked up after merge() has been called.

      In my case I could work around this if I could ask the proxy to initialize itself (DDC-733). More transparent would be a __clone() method in the proxy that initializes the proxy. This might also be related to DDC-18.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        This issue is rather tricky, since __clone is called AFTER the actual clone, on the CLONED object. What we need is before the clone on the original object. This is pretty problematic to solve, i have to wrap my head around it.

        Show
        Benjamin Eberlei added a comment - This issue is rather tricky, since __clone is called AFTER the actual clone, on the CLONED object. What we need is before the clone on the original object. This is pretty problematic to solve, i have to wrap my head around it.
        Hide
        Benjamin Eberlei added a comment -

        Fixed.

        Show
        Benjamin Eberlei added a comment - Fixed.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Karsten Dambekalns
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: