<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:02 UTC 2024

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 append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-1236] Non-unique key error handling</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1236</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;It appears that MongoCollection&amp;lt;TDocument&amp;gt;.InsertOneAsync throws a MongoWriteException which does not have any direct information about the kind of error happened, including non-unique key constraint violation. I checked the source and even single inserts are done via bulk write operations, which are inherently not very good at passing single-request error information. I was expecting MongoDuplicateKeyException to be thrown in case of such violation.&lt;br/&gt;
Is this going to change, or should we ignore the existence of MongoDuplicateKeyException and try to interrogate inner exceptions which seems very unwieldy?&lt;/p&gt;</description>
                <environment></environment>
        <key id="194810">CSHARP-1236</key>
            <summary>Non-unique key error handling</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="onyxmaster">Aristarkh Zagorodnikov</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Wed, 8 Apr 2015 16:26:46 +0000</created>
                <updated>Fri, 5 Apr 2019 13:59:20 +0000</updated>
                            <resolved>Wed, 8 Apr 2015 17:19:54 +0000</resolved>
                                    <version>2.0</version>
                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="875980" author="craiggwilson" created="Wed, 8 Apr 2015 17:19:54 +0000"  >&lt;p&gt;Yes, probably should have been moved. Alas, too late now.&lt;/p&gt;</comment>
                            <comment id="875977" author="onyxmaster" created="Wed, 8 Apr 2015 17:18:53 +0000"  >&lt;p&gt;Oh, Craig, I&apos;m okay with this (already added an IsDuplicateKeyError extension method for our toolset), it&apos;s just the MongoDuplicateKeyException that took me off the right course. Maybe it should be moved to legacy part of the driver?&lt;/p&gt;</comment>
                            <comment id="875924" author="craiggwilson" created="Wed, 8 Apr 2015 16:34:07 +0000"  >&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; I had a reply typed out about that you can check the WriteError.Category field...  C#6 will have exception filters which will make this much cleaner. &lt;/p&gt;

&lt;p&gt;We opted not to throw a MongoDuplicateKeyException because, well, why is it more special? Instead, we opted for a common consistent way to check for certain types of known errors.&lt;/p&gt;
</comment>
                            <comment id="875920" author="onyxmaster" created="Wed, 8 Apr 2015 16:31:05 +0000"  >&lt;p&gt;P.S. In understand that there is a WriteError field available and we can check the category, it&apos;s just the MongoDuplicateKeyException that is defined in non-legacy part of the driver, but is not used.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="227459">CSHARP-1390</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs7wjz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>