<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:05 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-355] Getting ConcurrentModificationException when load testing</title>
                <link>https://jira.mongodb.org/browse/JAVA-355</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;I have 100 threads each of them initializes a class of DBCollection and inserts 1000 records to the database.&lt;/p&gt;

&lt;p&gt;I am getting many errors of:&lt;/p&gt;

&lt;p&gt;Caused by: java.util.ConcurrentModificationException&lt;br/&gt;
        at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)&lt;br/&gt;
        at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:384)&lt;br/&gt;
        at com.mongodb.DBCollection._checkKeys(DBCollection.java:1076)&lt;br/&gt;
        at com.mongodb.DBCollection._checkObject(DBCollection.java:1067)&lt;br/&gt;
        at com.mongodb.DBCollection.save(DBCollection.java:614)&lt;br/&gt;
        at com.mongodb.DBCollection.save(DBCollection.java:599)&lt;/p&gt;</description>
                <environment></environment>
        <key id="17267">JAVA-355</key>
            <summary>Getting ConcurrentModificationException when load testing</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="antoine">Antoine Girbal</assignee>
                                    <reporter username="mbergman">Moshe Bergman</reporter>
                        <labels>
                            <label>concurrency</label>
                    </labels>
                <created>Thu, 19 May 2011 14:28:06 +0000</created>
                <updated>Wed, 19 Oct 2016 14:17:24 +0000</updated>
                            <resolved>Mon, 30 May 2011 14:44:39 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="35138" author="mbergman" created="Mon, 30 May 2011 07:40:44 +0000"  >&lt;p&gt;My apologies, the problem was in my code. Please remove this bug.&lt;/p&gt;</comment>
                            <comment id="34095" author="mbergman" created="Tue, 24 May 2011 07:34:46 +0000"  >&lt;p&gt;I sent it by e-mail&lt;/p&gt;</comment>
                            <comment id="33510" author="mbergman" created="Thu, 19 May 2011 15:00:47 +0000"  >&lt;p&gt;Even with different recordId I am still getting the errors.&lt;/p&gt;

&lt;p&gt;I&apos;ll need to get permission to send the source code. I expect I will be able to send it on Monday.&lt;/p&gt;</comment>
                            <comment id="33504" author="eliot" created="Thu, 19 May 2011 14:36:16 +0000"  >&lt;p&gt;Each find should return a different one, but a DBObject is definitely not thread safe.&lt;br/&gt;
Can you attach your code?&lt;/p&gt;</comment>
                            <comment id="33503" author="mbergman" created="Thu, 19 May 2011 14:31:10 +0000"  >&lt;p&gt;I&apos;ll add a note:&lt;/p&gt;

&lt;p&gt;At the beginning each thread queries the DB for the same record (recordId: &quot;sampleRecord&quot;)&lt;/p&gt;

&lt;p&gt;Then each thread removes the _id field from DBObject, changes the recordId to a new number and inserts to the database.&lt;/p&gt;

&lt;p&gt;Is it possible that on all 100 threads the DBObject is pointing to the same object and thus the Concurrency exception?&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|hrhc3b:</customfieldvalue>

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