<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 10:56:09 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-668/DDC-668.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-668] add upsert support</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-668</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;Didnt find anything in the docs on this. Is D2 capable of doing an UPSERT &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; in case I am trying to persist an object that may or may not have been saved previously. Different RDBMS support different syntax for this case. Like MySQL has INSERT .. ON DUPLICATE KEY UPDATE (or even INSERT IGNORE) while the SQL standard defines a MERGE syntax which seems to be gaining support. Of course you can always fallback to a SELECT FOR UPDATE (or if you want to be hacky an INSERT which catches duplicate key violations .. but probably not a good idea since many RDBMS rollback on a failure inside a transaction).&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Upsert&quot; class=&quot;external-link&quot;&gt;http://en.wikipedia.org/wiki/Upsert&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See also &lt;a href=&quot;http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011&quot; class=&quot;external-link&quot;&gt;http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011&lt;/a&gt; asking for MERGE support&lt;/p&gt;

&lt;p&gt;Ideally there would be a way to define on a model or model instance level if merge logic should be applied.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11585">DDC-668</key>
            <summary>add upsert support</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</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="lsmith">Lukas Kahwe</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Jul 2010 17:20:19 +0000</created>
                <updated>Tue, 20 Dec 2011 22:22:01 +0000</updated>
                                                    <fixVersion>2.x</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="13543" author="robertb" created="Fri, 9 Jul 2010 01:16:50 +0000"  >&lt;p&gt;Doctrine_Record defines a replace() method. &lt;/p&gt;

&lt;p&gt;In the MySQL Doctrine implementation, however, it is not the same as INSERT .. ON DUPLICATE KEY UPDATE. The replace() method implemented in Doctrine_Connection_Mysql uses the REPLACE INTO syntax, which is a DELETE and then INSERT when the key exists. This is fine, except for tables that use auto-increment fields. The delete-then-insert operation yields a new auto-incremented value, whereas INSERT .. ON DUPLICTATE KEY UPDATE would not.&lt;/p&gt;</comment>
                    <comment id="13544" author="lsmith" created="Fri, 9 Jul 2010 02:34:53 +0000"  >&lt;p&gt;MySQL (and SQLite) REPLACE is a no go. It causes way too much disc I/O and worse yet totally screws up the on disk data structures because of the deleting.&lt;/p&gt;</comment>
                    <comment id="16238" author="beberlei" created="Sun, 31 Jul 2011 08:48:13 +0000"  >&lt;p&gt;Scheduled for 2.2&lt;/p&gt;</comment>
                    <comment id="16239" author="beberlei" created="Sun, 31 Jul 2011 09:09:56 +0000"  >&lt;p&gt;Evaluating this makes me sad, except MySQL support for this is rather non-existant, and the oracle merge is aiming at batch operations.&lt;/p&gt;</comment>
                    <comment id="16681" author="beberlei" created="Sat, 22 Oct 2011 11:08:32 +0000"  >&lt;p&gt;Should this be done with&lt;/p&gt;

&lt;p&gt;1. Select first, then insert&lt;br/&gt;
2. Catch and evaluate exception then update&lt;/p&gt;

&lt;p&gt;I am leaning towards 1.&lt;/p&gt;</comment>
                    <comment id="17074" author="guilhermeblanco" created="Tue, 20 Dec 2011 22:22:01 +0000"  >&lt;p&gt;Updating fix version&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>