<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu Jun 20 02:39:39 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://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-1987/DDC-1987.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.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-1987] Cascading &quot;refresh&quot; does not work on lazy loaded associations</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1987</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If the cascade option for an association includes the &quot;refresh&quot; keyword, the associated entites are only refreshed, if the collection is not lazy loaded.&lt;/p&gt;

&lt;p&gt;The problem is that first the &quot;parent&quot; entity is reloaded, so the associations PersistentCollection is replaced with a new one that has not been initialized yet. And then in cascadeRefresh, the code explicitly avoids initializing that collection, so there will never be any entities in the wrapped ArrayCollection that the operation may cascade to.&lt;/p&gt;

&lt;p&gt;I can see at least two possible solutions for this problem. One would be to swap the order of the operations, so that the cascading happens first. This would cascade based on the current object model state (pre-refresh), so entities that had been detached would not be refreshed.&lt;/p&gt;

&lt;p&gt;The other would be to remember which collections had already been loaded, and to initialize the corresponding new collections before performing the cascading. That would cascade based on the refreshed state, so in this case, entities that had been newly attached would not be refreshed.&lt;/p&gt;

&lt;p&gt;My current use-case would work with the first one, but I guess there will be some use-cases that would require the second one... :-/&lt;/p&gt;</description>
                <environment></environment>
            <key id="13971">DDC-1987</key>
            <summary>Cascading &quot;refresh&quot; does not work on lazy loaded associations</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="sbeining">Sascha Beining</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Aug 2012 14:15:04 +0000</created>
                <updated>Sun, 31 Mar 2013 11:14:31 +0000</updated>
                    <resolved>Sun, 31 Mar 2013 11:14:15 +0000</resolved>
                            <version>2.1.7</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="18573" author="beberlei" created="Wed, 29 Aug 2012 12:57:54 +0000"  >&lt;p&gt;Tricky issue. I share your analysis and ask myself if there is really a use-case for 2. If you ask for a refresh of the current state, that obviously means the current associations. Hence cascading first would be the solution here.&lt;/p&gt;

&lt;p&gt;The problem is that the entities are still in memory and a consecutive access of the &quot;new&quot; collection returns them in their non-refreshed state.&lt;/p&gt;

&lt;p&gt;You could help with solving this issue, can you create a TestCase like the ones in tests/Doctrine/Tests/ORM/Functional/Ticket/* and attach it here? It would be best against master, but ok if you do it against 2.1.7.&lt;/p&gt;
</comment>
                    <comment id="19382" author="ocramius" created="Wed, 23 Jan 2013 22:13:17 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=sbeining&quot; class=&quot;user-hover&quot; rel=&quot;sbeining&quot;&gt;Sascha Beining&lt;/a&gt; 2.1 is not supported anymore. Can you verify if this behaviour is still reproducible in 2.3?&lt;/p&gt;</comment>
                    <comment id="19519" author="asm89" created="Sun, 10 Feb 2013 11:50:21 +0000"  >&lt;p&gt;ping! &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="19907" author="beberlei" created="Sun, 31 Mar 2013 11:14:15 +0000"  >&lt;p&gt;closing in favor of &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-2143&quot; title=&quot;$em-&amp;gt;refresh($entity) doesn&amp;#39;t refresh associations cleared with clear()&quot;&gt;&lt;del&gt;DDC-2143&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="14222">DDC-2143</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>