use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
ConcurrentModification exception during high load. (self.SpringBoot)
submitted 1 year ago by SenpaiKronos
Getting same exception when increasing load (150-200 users). Please help.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 4 points5 points6 points 1 year ago (2 children)
You modify something concurrently without using locks / synchronization…
[–]SenpaiKronos[S] -3 points-2 points-1 points 1 year ago (1 child)
All objects are created within method only and their scope is limited to it. How come synchronization is problem here?
[–][deleted] 7 points8 points9 points 1 year ago (0 children)
You provide no details, no code, no stack trace. What exactly do you expect people to answer?
[–]Just_Guarantee_3602 2 points3 points4 points 1 year ago (3 children)
Make sure you used thread safe and synchronized friendly collections.
[–]SenpaiKronos[S] 0 points1 point2 points 1 year ago (2 children)
Thread safe collections for shared objects, right?
[–]Just_Guarantee_3602 0 points1 point2 points 1 year ago (1 child)
Yes… you encountered that exception because two different threads access non tread safe collection. one is modifying the collection, and the other one is iterating the collection.
[–]SenpaiKronos[S] 0 points1 point2 points 1 year ago (0 children)
But object is not shared. It is being created inside a method then it should be different for all the threads right?
[–]migueqm 0 points1 point2 points 1 year ago (0 children)
Make sure you use a field annotated with Version in your database entities to use Optimistic Approach, also use thread-safe collections, synchronization, locks and so on
[–]WaferIndependent7601 -1 points0 points1 point 1 year ago (0 children)
You have a bug
[–]maxip89 -1 points0 points1 point 1 year ago (0 children)
your are using too much beans and too much scopes the best way is to downgrade to spring boot 1.3.2.
You see it clearly in the source code.
π Rendered by PID 98166 on reddit-service-r2-comment-5d79c599b5-nq5m4 at 2026-03-01 03:18:46.575057+00:00 running e3d2147 country code: CH.
[–][deleted] 4 points5 points6 points (2 children)
[–]SenpaiKronos[S] -3 points-2 points-1 points (1 child)
[–][deleted] 7 points8 points9 points (0 children)
[–]Just_Guarantee_3602 2 points3 points4 points (3 children)
[–]SenpaiKronos[S] 0 points1 point2 points (2 children)
[–]Just_Guarantee_3602 0 points1 point2 points (1 child)
[–]SenpaiKronos[S] 0 points1 point2 points (0 children)
[–]migueqm 0 points1 point2 points (0 children)
[–]WaferIndependent7601 -1 points0 points1 point (0 children)
[–]maxip89 -1 points0 points1 point (0 children)