<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:58:23 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-2928] Detect if transactions are not supported by the server</title>
                <link>https://jira.mongodb.org/browse/JAVA-2928</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;When running:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;ClientSession clientSession = mongoClient.startSession();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;clientSession.startTransaction();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;collection.insertOne(clientSession, Document.parse(&quot;{_id: 1, a: 1}&quot;));&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;collection.insertOne(clientSession, Document.parse(&quot;{_id: 2, a: 1}&quot;));&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;clientSession.commitTransaction();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;clientSession.close();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Against a 3.6 replicaset or sharded cluster the user gets the following error:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Exception in thread &quot;main&quot; com.mongodb.MongoCommandException: Command failed with error 40415 (Location40415): &apos;BSON field &apos;insert.startTransaction&apos; is an unknown field.&apos; on server localhost:27017. The full response is { &quot;operationTime&quot; : { &quot;$timestamp&quot; : { &quot;t&quot; : 1534322289, &quot;i&quot; : 4 } }, &quot;ok&quot; : 0.0, &quot;errmsg&quot; : &quot;BSON field &apos;insert.startTransaction&apos; is an unknown field.&quot;, &quot;code&quot; : 40415, &quot;codeName&quot; : &quot;Location40415&quot;, &quot;$clusterTime&quot; : { &quot;clusterTime&quot; : { &quot;$timestamp&quot; : { &quot;t&quot; : 1534322289, &quot;i&quot; : 4 } }, &quot;signature&quot; : { &quot;hash&quot; : { &quot;$binary&quot; : &quot;AAAAAAAAAAAAAAAAAAAAAAAAAAA=&quot;, &quot;$type&quot; : &quot;00&quot; }, &quot;keyId&quot; : { &quot;$numberLong&quot; : &quot;0&quot; } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Its quite unclear as to what the cause of the actual issue is.&lt;/p&gt;

&lt;p&gt;For other scenarios the errors are much clearer: &lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Single Node: &lt;tt&gt;com.mongodb.MongoClientException: Sessions are not supported by the MongoDB cluster to which this client is connected&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;Sharded cluster: &lt;tt&gt;com.mongodb.MongoCommandException: Command failed with error 50841 (Location50841): &apos;Multi-document transactions cannot be run in a sharded cluster.&apos;&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The spec states: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;startTransaction SHOULD report an error if the driver can detect that transactions are not supported by the deployment. &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;A wire check would allow for clearer error messages for users trying to use transactions on an older server.&lt;/p&gt;</description>
                <environment></environment>
        <key id="588645">JAVA-2928</key>
            <summary>Detect if transactions are not supported by the server</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="john.stewart@mongodb.com">John Stewart</assignee>
                                    <reporter username="ross@mongodb.com">Ross Lawley</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Aug 2018 08:49:22 +0000</created>
                <updated>Sat, 28 Oct 2023 11:22:45 +0000</updated>
                            <resolved>Thu, 24 Jan 2019 20:06:29 +0000</resolved>
                                                    <fixVersion>3.11.0</fixVersion>
                                    <component>Transaction Management</component>
                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2127790" author="jeff.yemin" created="Fri, 25 Jan 2019 17:17:15 +0000"  >&lt;p&gt;commit 668ccb549d8bbb803cfac20598a0a23189fbc11e (HEAD -&amp;gt; master, mongodb/master)&lt;br/&gt;
Author: John Stewart &amp;lt;john.stewart@mongodb.com&amp;gt;&lt;br/&gt;
Date:   Fri Jan 11 19:21:32 2019 -0500&lt;/p&gt;

&lt;p&gt;    detect if transactions are not supported by the server&lt;/p&gt;</comment>
                            <comment id="2085231" author="mongdb-test" created="Mon, 10 Dec 2018 09:30:39 +0000"  >&lt;p&gt;hi,Is there any solution?&lt;/p&gt;</comment>
                    </comments>
                    <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|hr85yv:</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>