You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to build up an java app to retrieve data from ArangoDB, there was always an exception happen ConcurrentModificationException when calling SimpleArangoRepository.findAllById with concurrent workers, why? Is this meet expectation? Then what's the best practice to call the findAllById in concurrent environment?
The detailed call process is as following:
// the goal is to find whether the given items are already existing in the database or not. and this check would be called by multiple workers with different IDs.
List existingTiles = new ArrayList<>();
tileRepo.findAllById(tileIds.stream().map(String::valueOf).toList()).forEach(existingTiles::add);
The call stack for the exception is as following:
java.util.ConcurrentModificationException
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1229)
at com.arangodb.springframework.core.mapping.DefaultArangoPersistentEntity.findAnnotations(DefaultArangoPersistentEntity.java:269)
at com.arangodb.springframework.core.mapping.DefaultArangoPersistentEntity.getIndexes(DefaultArangoPersistentEntity.java:242)
at com.arangodb.springframework.core.mapping.DefaultArangoPersistentEntity.getPersistentIndexes(DefaultArangoPersistentEntity.java:210)
at com.arangodb.springframework.core.template.ArangoTemplate.ensureCollectionIndexes(ArangoTemplate.java:166)
at com.arangodb.springframework.core.template.ArangoTemplate._collection(ArangoTemplate.java:159)
at com.arangodb.springframework.core.template.ArangoTemplate._collection(ArangoTemplate.java:139)
at com.arangodb.springframework.core.template.ArangoTemplate._collection(ArangoTemplate.java:132)
at com.arangodb.springframework.core.template.ArangoTemplate.findAll(ArangoTemplate.java:484)
at com.arangodb.springframework.repository.SimpleArangoRepository.findAllById(SimpleArangoRepository.java:135)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
The text was updated successfully, but these errors were encountered:
When I try to build up an java app to retrieve data from ArangoDB, there was always an exception happen ConcurrentModificationException when calling SimpleArangoRepository.findAllById with concurrent workers, why? Is this meet expectation? Then what's the best practice to call the findAllById in concurrent environment?
The detailed call process is as following:
// the goal is to find whether the given items are already existing in the database or not. and this check would be called by multiple workers with different IDs.
List existingTiles = new ArrayList<>();
tileRepo.findAllById(tileIds.stream().map(String::valueOf).toList()).forEach(existingTiles::add);
The call stack for the exception is as following:
java.util.ConcurrentModificationException
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1229)
at com.arangodb.springframework.core.mapping.DefaultArangoPersistentEntity.findAnnotations(DefaultArangoPersistentEntity.java:269)
at com.arangodb.springframework.core.mapping.DefaultArangoPersistentEntity.getIndexes(DefaultArangoPersistentEntity.java:242)
at com.arangodb.springframework.core.mapping.DefaultArangoPersistentEntity.getPersistentIndexes(DefaultArangoPersistentEntity.java:210)
at com.arangodb.springframework.core.template.ArangoTemplate.ensureCollectionIndexes(ArangoTemplate.java:166)
at com.arangodb.springframework.core.template.ArangoTemplate._collection(ArangoTemplate.java:159)
at com.arangodb.springframework.core.template.ArangoTemplate._collection(ArangoTemplate.java:139)
at com.arangodb.springframework.core.template.ArangoTemplate._collection(ArangoTemplate.java:132)
at com.arangodb.springframework.core.template.ArangoTemplate.findAll(ArangoTemplate.java:484)
at com.arangodb.springframework.repository.SimpleArangoRepository.findAllById(SimpleArangoRepository.java:135)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
The text was updated successfully, but these errors were encountered: