<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:35:41 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>[GODRIVER-1104] Provide imperative transaction API</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1104</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;This issue follows from the GitHub discussion here:&#160;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/161&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/pull/161&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Basically, I believe that we should provide a transaction API similar to `database/sql` for these reasons:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The callback API is unfortunate to work with in real-world code. Even if there are concurrency problems, I would much prefer this as an option with clear documentation than be forced to use callbacks.&lt;/p&gt;

&lt;p&gt;Within the callback, it&apos;s more difficult to return the outer function or initialize outer variables. This leads to variable shadowing, interface type assertions, and duplicated error handling. All of which significantly increase the volume of code, and the probability of bugs.&lt;/p&gt;

&lt;p&gt;Lastly, Go packages should take inspiration from the stdlib as much as possible for a consistent user experience. The Go authors decided to avoid the callback API in database/sql.&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
        <key id="787962">GODRIVER-1104</key>
            <summary>Provide imperative transaction API</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="divjot.arora@mongodb.com">Divjot Arora</assignee>
                                    <reporter username="ammarb">Ammar Bandukwala</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Jun 2019 21:38:53 +0000</created>
                <updated>Sat, 28 Oct 2023 11:38:47 +0000</updated>
                            <resolved>Mon, 13 Apr 2020 18:50:41 +0000</resolved>
                                                    <fixVersion>1.4.0</fixVersion>
                                    <component>CRUD</component>
                                        <votes>1</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3037476" author="xgen-internal-githook" created="Mon, 13 Apr 2020 18:50:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Divjot Arora&apos;, &apos;email&apos;: &apos;divjot.arora@10gen.com&apos;, &apos;username&apos;: &apos;divjotarora&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-1104&quot; title=&quot;Provide imperative transaction API&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-1104&quot;&gt;&lt;del&gt;GODRIVER-1104&lt;/del&gt;&lt;/a&gt; Add imperative sessions API (#364)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/6a555e4b692695080afb33ebeefe5aee9be58ea6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/6a555e4b692695080afb33ebeefe5aee9be58ea6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3035670" author="divjot.arora" created="Fri, 10 Apr 2020 21:58:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/364&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/pull/364&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2780450" author="divjot.arora" created="Mon, 3 Feb 2020 16:36:05 +0000"  >&lt;p&gt;Putting this back into &quot;Needs Triage&quot; because we&apos;ve discussed this internally and think that this may be a good idea to have, as a callback-based API isn&apos;t always a usable solution for applications.&lt;/p&gt;</comment>
                            <comment id="2277693" author="kris.brandow" created="Mon, 10 Jun 2019 14:35:18 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ammarb&quot; class=&quot;user-hover&quot; rel=&quot;ammarb&quot;&gt;ammarb&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for filing this ticket. We understand that being forced to use a closure or callback to use the MongoDB Sessions API isn&apos;t ideal. We try to build flexible APIs but in this circumstance there is a high chance of misuse and that misuse is difficult to detect. This can result in a user thinking they&apos;ve protected themselves by using a transaction or session and not find out they didn&apos;t until something catastrophic happens. In other words, adding this API makes it too easy for users to use the API in a manner that defeats the main benefits of the API. In the future we will be redesigning the API of all the drivers to fix issues like this with sessions, so instead of adding this API now we will wait until that redesign happens.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Kris&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="1237373">GODRIVER-1523</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|hus21z:</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>