|
|
|
|
Re: ConcurrentModification Exception in JPA 3.0 [message #1840871 is a reply to message #1840107] |
Tue, 27 April 2021 16:43  |
Chris Delahunt Messages: 1389 Registered: July 2009 |
Senior Member |
|
|
My comments on read-only were to have you check that you aren't getting entity objects from the shared cache and rule out sharing those objects amongst threads as being part of the issue. If you are not setting that or finding query hints, annotations, properties or even descriptor customizers that hint at it (there quite a few ways ways to do it for a class), it seems likely you might be using the same Entity instance read in from one EntityManager among different threads. The refresh cascade setting would cause refreshes to trigger when lazy relationships are triggered, cascading throughout the object graph at different times, not just when the initial query executes. If you have multiple access points querying to different parts of the same root node(s) using that hint, it might force them to be refreshed multiple times. If just removing that setting and using refresh less liberally works to reduce/remove the occurrences of that error, it means that what you described, multiple threads refreshing the same entity graph structure at the same time - but it doesn't mean that EclipseLink's refresh is what is modifying the list, it could be your application itself. The refresh is just one process that must iterate over collection mappings and would hit the issue, but we don't see the thread/process that is modifying the list to know what others are involved. I don't know if you want to go looking to see if those threads are using the same EntityManager instance, as I suspect they must be somehow if the object with the IndirectSet getting the exception wasn't from the shared cache (via a read-only setting).
Best Regards,
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.02004 seconds