[JAVA-355] Getting ConcurrentModificationException when load testing Created: 19/May/11 Updated: 19/Oct/16 Resolved: 30/May/11 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Moshe Bergman | Assignee: | Antoine Girbal |
| Resolution: | Done | Votes: | 0 |
| Labels: | concurrency | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I have 100 threads each of them initializes a class of DBCollection and inserts 1000 records to the database. I am getting many errors of: Caused by: java.util.ConcurrentModificationException |
| Comments |
| Comment by Moshe Bergman [ 30/May/11 ] |
|
My apologies, the problem was in my code. Please remove this bug. |
| Comment by Moshe Bergman [ 24/May/11 ] |
|
I sent it by e-mail |
| Comment by Moshe Bergman [ 19/May/11 ] |
|
Even with different recordId I am still getting the errors. I'll need to get permission to send the source code. I expect I will be able to send it on Monday. |
| Comment by Eliot Horowitz (Inactive) [ 19/May/11 ] |
|
Each find should return a different one, but a DBObject is definitely not thread safe. |
| Comment by Moshe Bergman [ 19/May/11 ] |
|
I'll add a note: At the beginning each thread queries the DB for the same record (recordId: "sampleRecord") Then each thread removes the _id field from DBObject, changes the recordId to a new number and inserts to the database. Is it possible that on all 100 threads the DBObject is pointing to the same object and thus the Concurrency exception? |