Random "the session has been closed" errors from AEM
Hello Experts,
I appreciate any insights into what could be causing the below errror:
Caused by: javax.jcr.RepositoryException: This session has been closed.
at org.apache.jackrabbit.oak.jcr.session.SessionImpl.checkAlive(SessionImpl.java:141)
at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNodeById(SessionImpl.java:317)
at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNodeByIdentifier(SessionImpl.java:340)
at com.adobe.granite.repository.impl.CRX3SessionImpl.getNodeByIdentifier(CRX3SessionImpl.java:163)
Some context into what we are doing, We receive a JSON file from a third party client on the AEM via a servlet. At times the file could be huge, so we run the file processing in a background thread and give a asynchronous response to the client about the file reception.
As part of the file processing, we read and update data on JCR. To do this we create a service resourceResolver using a service user and then adapt it to a session. The problem is with this session being closed randomly in the processing of the file. Nothing explains the randomness of the issue.