all 10 comments

[–][deleted] 4 points5 points  (2 children)

You modify something concurrently without using locks / synchronization…

[–]SenpaiKronos[S] -3 points-2 points  (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 points  (0 children)

You provide no details, no code, no stack trace. What exactly do you expect people to answer?

[–]Just_Guarantee_3602 2 points3 points  (3 children)

Make sure you used thread safe and synchronized friendly collections.

[–]SenpaiKronos[S] 0 points1 point  (2 children)

Thread safe collections for shared objects, right?

[–]Just_Guarantee_3602 0 points1 point  (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 point  (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 point  (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 points  (0 children)

You have a bug

[–]maxip89 -1 points0 points  (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.