<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:26 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-499] Add support for connection validation</title>
                <link>https://jira.mongodb.org/browse/JAVA-499</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;The Java MongoDB driver has a built-in connection pool. One of the downsides of a connection pool is that pooled connections may become stale or broken over time (oftentimes due to timeouts, network issues, etc.).  As a result, many connection pooling implementations offer a mechanism by which pooled connections can be automatically validated (usually before use, after use, or periodically). Some examples include &lt;a href=&quot;http://commons.apache.org/dbcp/configuration.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DBCP&apos;s validationQuery &lt;/a&gt; and &lt;a href=&quot;http://www.mchange.com/projects/c3p0/index.html#configuring_connection_testing&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;c3p0&apos;s connection testing&lt;/a&gt;. It would be great if the Java MongoDB driver could also support for some means of connection validation.  Such a feature need not be as complex or general as in the above implementations. For example, while arbitrary validation queries might be desirable in some cases, something as simple as a &lt;a href=&quot;http://www.mongodb.org/display/DOCS/List+of+Database+Commands&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ping command&lt;/a&gt; seems like it would be sufficient to validate a connection in many cases.&lt;/p&gt;

&lt;p&gt;Test case:&lt;br/&gt;
I&apos;ve attached a rather contrived example which illustrates a case in which connection validation might be useful. To simulate connection failure, the test involves restarting mongod during a brief waiting period between two successive calls to MongoDB. The connection pool size is set to 1 to ensure that the pooled connection is used for the second call.&lt;/p&gt;</description>
                <environment></environment>
        <key id="27316">JAVA-499</key>
            <summary>Add support for connection validation</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="bross@playdom.com">Bryon Ross</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Dec 2011 23:36:24 +0000</created>
                <updated>Thu, 6 Apr 2023 18:54:34 +0000</updated>
                            <resolved>Wed, 25 Nov 2015 20:18:09 +0000</resolved>
                                    <version>2.6.5</version>
                                                    <component>Connection Management</component>
                                        <votes>7</votes>
                                    <watches>13</watches>
                                                                                                                <comments>
                            <comment id="366985" author="jeff.yemin" created="Tue, 25 Jun 2013 03:50:03 +0000"  >&lt;p&gt;After considering the tradeoffs, it&apos;s better to check for expired connections based on configurable maximum connection life time and idle time.  Linking to &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-710&quot; title=&quot;Support max connection idle time and max connection life time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-710&quot;&gt;&lt;del&gt;JAVA-710&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="266167" author="jeff.yemin" created="Thu, 14 Feb 2013 15:02:58 +0000"  >&lt;p&gt;There are tradeoffs involved though.  If the pool tests every connection on checkout, say, by calling the mongod &quot;ping&quot; command on it, it means there is an extra round trip to the server for every operation.  And even if it did, the socket could still go down after the ping and before the client uses it, so clients can not be totally insulated.&lt;/p&gt;

&lt;p&gt;That said, the connection pool could do more to minimize the likelihood of this happening by implementing max-time-in-pool and check-idle.  But it will never be eliminated, so clients have to be prepared to deal with failures anyway.&lt;/p&gt;</comment>
                            <comment id="266157" author="christian.tonhaeuser@navteq.com" created="Thu, 14 Feb 2013 14:54:15 +0000"  >&lt;p&gt;When using the java-driver, a developer shouldn&apos;t ever have to bother with connection problems/handling, i.e. the java driver should never hand out a stale connection for use by the client OR if it does, it should at least make sure to catch (and retry) any error conditions that can arise from a stale connection instead of letting the developer handling everything.&lt;/p&gt;

&lt;p&gt;Also, the example given by Bryon isn&apos;t that far fetched imho. In larger clusters, nodes tend to need restarts from time to time which in turn causes massive connection problems on the client side that all need to be handled in the application&apos;s code.&lt;/p&gt;

&lt;p&gt;Therefore +1 vote for this... &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/wink.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="24579">JAVA-466</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="58762">JAVA-710</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="14270" name="MongoPoolTest.java" size="2228" author="bross@playdom.com" created="Tue, 27 Dec 2011 23:36:24 +0000"/>
                    </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|hrgai7:</customfieldvalue>

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