I have a problem with a multithreading java process, in my main I launch a paged query and put the result in threads, where executes select, updates, and a lot of crazy things.
The methods used to do the query are Query.skip(int skip)
and Query.limit(int limit)
with 10.000 limit value.
The process throws the following exception when paged more than 800.000 elements:
Exception:org.springframework.dao.DataAccessResourceFailureException: Cursor XXXXXXXX not found on server XXXXXXXX:XXXXX; nested exception is com.mongodb.MongoException$CursorNotFound: Cursor XXXXXXXX not found on server XXXXXXXX:XXXXX
at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:60)
at org.springframework.data.mongodb.core.MongoTemplate.potentiallyConvertRuntimeException(MongoTemplate.java:1918)
at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:1801)
at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1612)
at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1596)
at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:535)
at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:526)
Where is the problem?
My mongo options:
<mongo:options auto-connect-retry="true"
connections-per-host="30"
socket-keep-alive="true" max-auto-connect-retry-time="15000"
max-wait-time="60000" socket-timeout="0" />
Versions:
Spring : 3.2.9.RELEASE
Spring Data Mongdb: 1.5.1.RELEASE
Mongo Java Driver: 2.12.2
Maybe some pictures would help:
Why the process is so big? Here is the answer StatelessKnowledgeSession Focus Agenda
Thanks!!!