<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:57:27 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>[JAVA-2533] Add type-safe way to detect max document size exceeded</title>
                <link>https://jira.mongodb.org/browse/JAVA-2533</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Add a type-safe way for applications to detect that a BSON document failed to serialize due to the maximum document size supported by MongoDB being exceeded.  Possibilities include:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;adding an enumeration to BsonSerializationException&lt;/li&gt;
	&lt;li&gt;adding a new exception type, e.g. BsonMaximumDocumentSizeExceedException&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Original Description&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;While catching an exception for the error &quot;MaxDocumentSize exceeded...&quot;, per &lt;a href=&quot;http://api.mongodb.com/java/current/org/bson/BsonSerializationException.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this&lt;/a&gt; ref, the errorCode is not populated.&lt;/p&gt;

&lt;p&gt;It would appear that the &lt;a href=&quot;http://api.mongodb.com/java/current/org/bson/BsonSerializationException.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BsonSerializationException constructor&lt;/a&gt; only accepts strings, while its superclass &lt;a href=&quot;http://api.mongodb.com/java/current/org/bson/BSONException.html#getErrorCode--&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BSONException&lt;/a&gt; can accept both string and a code (among its four constructors).&lt;/p&gt;

&lt;p&gt;Looking further at the &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/master/bson/src/main/org/bson/BsonSerializationException.java&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;source for BsonSerializationException&lt;/a&gt;, all it does is call &lt;tt&gt;super(message)&lt;/tt&gt; and nothing else.&lt;/p&gt;</description>
                <environment></environment>
        <key id="392027">JAVA-2533</key>
            <summary>Add type-safe way to detect max document size exceeded</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="13201">Fixed</resolution>
                                        <assignee username="ross@mongodb.com">Ross Lawley</assignee>
                                    <reporter username="luke.prochazka@mongodb.com">Luke Prochazka</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Jun 2017 05:55:45 +0000</created>
                <updated>Sun, 29 Oct 2023 02:32:41 +0000</updated>
                            <resolved>Mon, 12 Feb 2018 11:33:53 +0000</resolved>
                                    <version>3.4.2</version>
                                    <fixVersion>3.7.0</fixVersion>
                                    <component>BSON</component>
                                        <votes>2</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1802551" author="ross@10gen.com" created="Mon, 12 Feb 2018 11:36:21 +0000"  >&lt;p&gt;3.7.0 will introduce &lt;tt&gt;org.bson.BsonMaximumSizeExceededException&lt;/tt&gt; to cover size exceeded exceptions.&lt;/p&gt;</comment>
                            <comment id="1802545" author="xgen-internal-githook" created="Mon, 12 Feb 2018 11:31:21 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;ross.lawley@gmail.com&apos;, &apos;name&apos;: &apos;Ross Lawley&apos;, &apos;username&apos;: &apos;rozza&apos;}
&lt;p&gt;Message: Added BsonMaximumSizeExceededException&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2533&quot; title=&quot;Add type-safe way to detect max document size exceeded&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2533&quot;&gt;&lt;del&gt;JAVA-2533&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/0aee7384cde74391668af23a908efc74de3dabdd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/0aee7384cde74391668af23a908efc74de3dabdd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1799226" author="ross@10gen.com" created="Thu, 8 Feb 2018 10:11:13 +0000"  >&lt;p&gt;PR: &lt;a href=&quot;https://github.com/rozza/mongo-java-driver/pull/250&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/rozza/mongo-java-driver/pull/250&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1626659" author="gabrng@cisco.com" created="Wed, 19 Jul 2017 18:46:55 +0000"  >&lt;p&gt;The previous exception message was not from the latest 3.4.2 java driver. Here is an example from the latest if it helps you find the related code:&lt;/p&gt;

&lt;p&gt;org.bson.BsonSerializationException: Document size of 17514051 is larger than maximum of 16777216.&lt;/p&gt;

&lt;p&gt;Hope this helps. It would be very nice to have some type of enum to track this error as we have already seen that the exception message changes in different versions of the java driver.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000XNDhEIAX]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <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|hr94bz:</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>