<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:59:50 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>[CXX-644] auto_reconnect using ConnectionString API</title>
                <link>https://jira.mongodb.org/browse/CXX-644</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;If I use DBClientConnection () API to make mongodb connection, I can specify _autoReconnect	to be true which allow automatic reconnect on a connection failure.&lt;/p&gt;

&lt;p&gt;However, I am using following API to connect (recommended way?):&lt;br/&gt;
=====================================================&lt;br/&gt;
std::string errString; &lt;br/&gt;
mongo::ConnectionString mongoConnectionString = mongo::ConnectionString::parse(hostAndPortStr_, errString);&lt;br/&gt;
...&lt;br/&gt;
mongoPtr_ = mongoConnectionString.connect(errString);&lt;br/&gt;
if (!mongoPtr_-&amp;gt;auth(mongodbDatabase_, mongodbUsername_, mongodbPassword_, errString)) &lt;/p&gt;
{
        ...
        return false;
}
&lt;p&gt;;&lt;br/&gt;
============================================&lt;br/&gt;
I don&apos;t see a way to set auto_reconnect to true using this API.&lt;br/&gt;
Is auto_reconnect true or false in this case? &lt;br/&gt;
If it is false, how do I set it to true?&lt;/p&gt;

&lt;p&gt;Thanks in advance!&lt;/p&gt;</description>
                <environment>Linux version 2.6.32-504.3.3.el6.x86_64 (&lt;a href=&apos;mailto:mockbuild@x86-028.build.eng.bos.redhat.com&apos;&gt;mockbuild@x86-028.build.eng.bos.redhat.com&lt;/a&gt;) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-9) (GCC) ) #1 SMP Fri Dec 12 16:05:43 EST 2014&lt;br/&gt;
</environment>
        <key id="223630">CXX-644</key>
            <summary>auto_reconnect using ConnectionString API</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="Judy.Han">Judy Han [X]</reporter>
                        <labels>
                    </labels>
                <created>Fri, 31 Jul 2015 17:03:32 +0000</created>
                <updated>Wed, 11 Sep 2019 19:04:59 +0000</updated>
                            <resolved>Fri, 31 Jul 2015 18:57:32 +0000</resolved>
                                    <version>legacy-1.0.0</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="994148" author="judy.han" created="Fri, 31 Jul 2015 18:54:57 +0000"  >&lt;p&gt;Great, Thanks a lot! Please feel free to close the ticket.&lt;/p&gt;</comment>
                            <comment id="994137" author="adam.midvidy" created="Fri, 31 Jul 2015 18:45:07 +0000"  >&lt;p&gt;Hi Judy, If your deployment is a replicaSet (i.e. the connection string has the &apos;replSet&apos; parameter) then autoReconnect is enabled by default, as ConnectionString::connect will return an instance of DBClientReplicaSet. As I mentioned earlier, DBClientReplicaSet always uses autoReconnect.&lt;/p&gt;

&lt;p&gt;Adam&lt;/p&gt;</comment>
                            <comment id="994115" author="judy.han" created="Fri, 31 Jul 2015 18:33:30 +0000"  >&lt;p&gt;Hi Adam,&lt;br/&gt;
Thanks for the response. I have some follow up questions:&lt;br/&gt;
Suppose I am using  ConnectionString::connect() interface, and my server is configured as a replica set, do I have auto-reconnect enabled?&lt;br/&gt;
If the answer is yes, in case the whole replica set is down for a period of time before come up again, will auto-reconnect happen?&lt;br/&gt;
If the answer is no, and I want auto-reconnect, what options do I have and what is the recommended options?&lt;br/&gt;
Thanks!&lt;br/&gt;
Judy&lt;/p&gt;</comment>
                            <comment id="994094" author="adam.midvidy" created="Fri, 31 Jul 2015 18:15:01 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=Judy.Han&quot; class=&quot;user-hover&quot; rel=&quot;Judy.Han&quot;&gt;Judy.Han&lt;/a&gt;, the default value for autoReconnect on DBClientConnection is false. If you would like to specify autoReconnect, you should manually construct an instance of DBClientConnection and pass a value of true to the constructor for the autoReconnect parameter. &lt;/p&gt;

&lt;p&gt;The reason this is not supported through the ConnectionString::connect() interface is that other connection types, such as DBClientReplicaSet, have different autoReconnect semantics - i.e. for DBClientReplicaSet, autoReocnnect is always enabled.&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|hsc9cf:</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>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="632">Platform 7 08/10/15</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>