<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:04:06 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-5249] CommandEvent publisher catches all exceptions</title>
                <link>https://jira.mongodb.org/browse/JAVA-5249</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;When I used &quot;CommandListener&quot;, I encountered the problem of exception being caught. My scenario is that if no condition (Filter) is specified when modifying or deleting, an exception will be thrown, which is considered a dangerous operation, but in the end I threw The exception was caught by the sendCommandStartedEvent method of the ProtocolHelper class. After the capture, it was not thrown again, causing my program to continue executing and all collection data to be deleted. Is there any way to bypass the capture, or is there anything else? The method allows me to obtain it before the statement is executed, such as the interceptor in MyBatis &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/491766/491766_image-2023-11-22-22-05-37-948.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2507330">JAVA-5249</key>
            <summary>CommandEvent publisher catches all exceptions</summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</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="13203">Gone away</resolution>
                                        <assignee username="slav.babanin@mongodb.com">Slav Babanin</assignee>
                                    <reporter username="j15030047216@163.com">chaoyang jia</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Nov 2023 14:10:43 +0000</created>
                <updated>Fri, 15 Dec 2023 12:00:30 +0000</updated>
                            <resolved>Fri, 15 Dec 2023 12:00:28 +0000</resolved>
                                    <version>4.9.0</version>
                                                    <component>Command Logging and Monitoring</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5953206" author="dbeng-pm-bot" created="Fri, 15 Dec 2023 12:00:30 +0000"  >&lt;p&gt;There hasn&apos;t been any recent activity on this ticket, so we&apos;re resolving it. Thanks for reaching out! Please feel free to reopen this ticket if you&apos;re still experiencing the issue, and add a comment if you&apos;re able to provide more information.&lt;/p&gt;</comment>
                            <comment id="5932509" author="dbeng-pm-bot" created="Thu, 7 Dec 2023 13:11:00 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=j15030047216%40163.com&quot; class=&quot;user-hover&quot; rel=&quot;j15030047216@163.com&quot;&gt;j15030047216@163.com&lt;/a&gt;! &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-5249&quot; title=&quot;CommandEvent publisher catches all exceptions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-5249&quot;&gt;&lt;del&gt;JAVA-5249&lt;/del&gt;&lt;/a&gt; is awaiting your response. &lt;/p&gt;

&lt;p&gt;If this is still an issue for you, please open Jira to review the latest status and provide your feedback. Thanks!&lt;/p&gt;</comment>
                            <comment id="5913656" author="JIRAUSER1273474" created="Wed, 29 Nov 2023 20:06:29 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=j15030047216%40163.com&quot; class=&quot;user-hover&quot; rel=&quot;j15030047216@163.com&quot;&gt;j15030047216@163.com&lt;/a&gt;. Thank you for reaching out!&lt;/p&gt;

&lt;p&gt;The CommandListener API is designed to receive and handle events without directly influencing command execution. Its primary role is to inform listeners about commands sent and replies received. The API shouldn&apos;t be used to execute custom logic around specific commands to determine success or failure.&lt;/p&gt;

&lt;p&gt;I&apos;d suggest validating queries at the application level to ensure safety.&lt;/p&gt;</comment>
                            <comment id="5907854" author="JIRAUSER1273005" created="Tue, 28 Nov 2023 01:23:28 +0000"  >&lt;p&gt;I temporarily threw another subclass of &apos;Error&apos; of the &apos;Throwable&apos; class to solve this problem, but I still want to know why the exception should be caught and not thrown twice. Will there be other security risks? If so, I hope you can tell me and I will consider whether what I am doing is right.&lt;/p&gt;</comment>
                            <comment id="5898634" author="JIRAUSER1273005" created="Wed, 22 Nov 2023 14:16:55 +0000"  >&lt;p&gt;This also caused me to be unable to roll back the transaction when I caught the exception.&lt;br/&gt;
Is the purpose of the Mongo team doing this to avoid some risks? If so, I hope you can tell me so I can weigh the pros and cons.&lt;/p&gt;</comment>
                            <comment id="5898620" author="dbeng-pm-bot" created="Wed, 22 Nov 2023 14:10:46 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=j15030047216%40163.com&quot; class=&quot;user-hover&quot; rel=&quot;j15030047216@163.com&quot;&gt;j15030047216@163.com&lt;/a&gt;, thank you for reporting this issue! The team will look into it and get back to you soon. &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="491766" name="image-2023-11-22-22-05-37-948.png" size="556481" author="j15030047216@163.com" created="Wed, 22 Nov 2023 14:05:41 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                        <customfield id="customfield_23812" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Assigned Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26447"><![CDATA[Java Drivers]]></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|i27m64:3</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>