<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 04:13:02 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/CODM-31/CODM-31.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>[CODM-31] UnitOfWork#doDetach does not remove a document from the identityMap - uses incorrect index</title>
                <link>http://www.doctrine-project.org/jira/browse/CODM-31</link>
                <project id="10050" key="CODM">Doctrine CouchDB ODM</project>
                        <description>&lt;p&gt;In UnitOfWork on line 656 the &lt;em&gt;oid&lt;/em&gt; is used to index the identity map instead of the document id when detaching an object. This is probably due to an incomplete port from the ORM. The following change fixes the bug (I will make the change and request a merge):&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Currently:&lt;/b&gt;&lt;br/&gt;
&lt;tt&gt;656: if (isset($this-&amp;gt;identityMap&lt;span class=&quot;error&quot;&gt;&amp;#91;$oid&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Should be:&lt;/b&gt;&lt;br/&gt;
&lt;tt&gt;656: if (isset($this-&amp;gt;identityMap[$this-&amp;gt;documentIdentifiers&lt;span class=&quot;error&quot;&gt;&amp;#91;$oid&amp;#93;&lt;/span&gt;])) {&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Further suggestion&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Since the document id is guaranteed to be unique would it not be better to do away with the &lt;em&gt;oid&lt;/em&gt; completely? It seems the following would be a relatively cheap substitute for the current &lt;em&gt;getDocumentIdentifier()&lt;/em&gt; implementation (excluding the check that it is managed which is also currently done in this method):&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;public function getDocumentIdentifier($document)&lt;/tt&gt;&lt;br/&gt;
{&lt;br/&gt;
  &lt;tt&gt;$class = $this-&amp;gt;dm-&amp;gt;getClassMetadata(get_class($document));&lt;/tt&gt;&lt;br/&gt;
  &lt;tt&gt;return $class-&amp;gt;getIdentifierValue($document);&lt;/tt&gt;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Then all the arrays in the UnitOfWork can be indexed using the document id and the above method can be called to obtain that wherever &lt;em&gt;spl_object_hash&lt;/em&gt; is currently used to obtain the &lt;em&gt;$oid&lt;/em&gt;. (Of course, if running &lt;em&gt;spl_object_hash&lt;/em&gt; is faster than retrieving the doc id as I suggest above then the current implementation is better.)&lt;/p&gt;</description>
                <environment></environment>
            <key id="12914">CODM-31</key>
            <summary>UnitOfWork#doDetach does not remove a document from the identityMap - uses incorrect index</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="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="marnusw">Marnus Weststrate</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Aug 2011 14:55:01 +0000</created>
                <updated>Mon, 15 Aug 2011 20:40:07 +0000</updated>
                    <resolved>Mon, 15 Aug 2011 20:40:07 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>