<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Mon May 20 00:40:57 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-1441/DDC-1441.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-1441] Metadata cannot be loaded for not registered proxy objects</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1441</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;We are using several Doctrine managers in our project with the same entity classes and different database tables.&lt;/p&gt;

&lt;p&gt;The problem appears when we are willing to merge entity with lazy associations from one manager to another. The second entity manager instance hasn&apos;t got the proxy object metadata defined yet so it fails with Doctrine\ORM\Mapping\MappingException exception &quot;Class EntityProxy is not a valid entity or mapped super class.&quot;.&lt;/p&gt;

&lt;p&gt;If both entity managers share the proxy objects the problem can be fixed by calling &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;$em-&amp;gt;getProxyFactory()-&amp;gt;getProxy(&apos;Entity&apos;, -1);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which will register the entity metadata for the proxy classname as well.&lt;/p&gt;

&lt;p&gt;Still if the proxy configuration differs, there is no fix found without changing the Doctrine ORM code.&lt;/p&gt;

&lt;p&gt;The fix inside the Doctrine would be to detect Proxy classes before loading the metadata and load the metadata for it&apos;s parent class instead. Please see the diff attached with proposed solution.&lt;/p&gt;

&lt;p&gt;Also I think this issue could arise when unserialized entity objects will be merged into the entity manager. I will try creating test case for this.&lt;/p&gt;</description>
                <environment>MySQL, Ubuntu, PHP 5.3.6</environment>
            <key id="13106">DDC-1441</key>
            <summary>Metadata cannot be loaded for not registered proxy objects</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="gedrox">Aigars Gedroics</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Oct 2011 13:02:43 +0000</created>
                <updated>Thu, 5 Apr 2012 08:39:55 +0000</updated>
                                    <version>2.1.2</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16913" author="gedrox" created="Thu, 24 Nov 2011 14:45:46 +0000"  >&lt;p&gt;Test case attached.&lt;/p&gt;</comment>
                    <comment id="17768" author="gedrox" created="Thu, 5 Apr 2012 08:39:55 +0000"  >&lt;p&gt;See my pull request in &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/332&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/332&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11116" name="DDC1441Test.php" size="2539" author="gedrox" created="Thu, 24 Nov 2011 14:45:46 +0000" />
                    <attachment id="11077" name="not-loaded-proxy-patch.diff" size="1096" author="gedrox" created="Thu, 20 Oct 2011 13:02:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>