<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sun May 26 02:13:38 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-1690/DDC-1690.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-1690] Notify policy listeners are not attached to entities with Notify policy</title>
                <link>http://doctrine-project.org/jira/browse/DDC-1690</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;It seems that it happens because the UnitOfWork::addToIdentityMap() is not the only way to add an entity to the identity map. It is possible to do it directly by assigning array values (pulling my hair why?) . But the code in that method also adds a property changed listener to an entity. As a result that entity is not persisted properly as it does not have a listener. I spent a lot of time trying to figure out why some of my entities were persisted and others no. That happens for entities of same class with parent - children associations.&lt;/p&gt;

&lt;p&gt;Probably the notify policy is not very popular otherwise the bug would have been reported long time ago.&lt;/p&gt;

&lt;p&gt;Adding these lines to the UnitOfWork at line 2004 fixes the issue:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-comment&quot;&gt;// PERF: Inlined &amp;amp; optimized code from UnitOfWork#registerManaged()
&lt;/span&gt;    $newValueOid = spl_object_hash($newValue);
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityIdentifiers[$newValueOid] = $associatedId;
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;identityMap[$targetClass-&amp;gt;rootEntityName][$relatedIdHash] = $newValue;
    &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; lines
&lt;/span&gt; -- &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($newValue &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; NotifyPropertyChanged) {
 --     $newValue-&amp;gt;addPropertyChangedListener($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);
 -- }
    &lt;span class=&quot;code-comment&quot;&gt;//end of &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; lines
&lt;/span&gt;    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;entityStates[$newValueOid] = self::STATE_MANAGED;
    &lt;span class=&quot;code-comment&quot;&gt;// make sure that when an proxy is then &lt;span class=&quot;code-keyword&quot;&gt;finally&lt;/span&gt; loaded, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;originalEntityData is set also!&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13509">DDC-1690</key>
            <summary>Notify policy listeners are not attached to entities with Notify policy</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="deatheriam">Oleg Namaka</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Mar 2012 01:59:41 +0000</created>
                <updated>Sat, 22 Dec 2012 11:48:43 +0000</updated>
                    <resolved>Sat, 22 Dec 2012 11:48:43 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.3.2</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17590" author="guilhermeblanco" created="Thu, 15 Mar 2012 05:37:22 +0000"  >&lt;p&gt;Changing the code (Perf &amp;amp; Inline block) to this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;registerManaged($newValue, $associatedId, array($field =&amp;gt; $newValue));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also fixed the issue and the performance impact was around 3% during my tests.&lt;/p&gt;</comment>
                    <comment id="17850" author="deatheriam" created="Mon, 16 Apr 2012 02:45:28 +0000"  >&lt;p&gt;So Doctrine 2.2.2 is out but the fix for this serious issue was not included in it. What version then it is supposed to fix? Doctrine seems to be riddled with issues related to the Notify strategy (look here for another related issue: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1775&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DDC-1775&lt;/a&gt;). It renders that strategy unusable.&lt;/p&gt;</comment>
                    <comment id="19163" author="pschwisow" created="Thu, 20 Dec 2012 21:41:00 +0000"  >&lt;p&gt;Submitted a pull request for this fix: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/541&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/541&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>