Every asset lock-unlock operation leaves an active session | Community
Skip to main content
Level 2
July 21, 2017
Solved

Every asset lock-unlock operation leaves an active session

  • July 21, 2017
  • 2 replies
  • 1096 views

Hello,

After checking that in our PRO AEM environment the active sessions number is increasing over the time, we have performed a small test. Basically, from an external application we are modifying the content and every modification is performed between a lock-unlock block. Surprisingly, every lock operation creates a new active session that is not released neither after unlocking nor after logging out. We track the number of active sessions using the AEM monitory tool (http://localhost:4502/libs/granite/operations/content/monitoring/page.html ).  ¿Is there a way to release all those active sessions?

Regards.

This is the test code we are using for AEM 6.2 using Apache OAK 1.4.1:

import javax.jcr.Node;

import javax.jcr.Repository;

import javax.jcr.RepositoryException;

import javax.jcr.Session;

import javax.jcr.SimpleCredentials;

import javax.jcr.lock.Lock;

import javax.jcr.lock.LockManager;

import org.apache.jackrabbit.commons.JcrUtils;

import com.hpe.session.SessionManager;

public class JCRTestLock {

    public static void main(String args[]) throws RepositoryException {

        String url = "http://localhost:4502/crx/server";

        String user = "admin";

        String passwd = "admin";

        String nodePath = "/content/dam/assets/2d8b4071-bd58-4d65-aa73-c0c5df5459123.png";

        Repository repository = JcrUtils.getRepository(url);

        SimpleCredentials credentials = new SimpleCredentials(user,

                passwd.toCharArray());

        Session session = repository.login(credentials, "crx.default");

        Node node = session.getNode(nodePath);

        LockManager lm = node.getSession().getWorkspace().getLockManager();

        Lock lock;

        for (int i = 0; i < 10; i++) {

            lock = lm.lock(nodePath, true, false, 10, session.getUserID());

            lm.unlock(nodePath);

        }

        session.logout();

    }

}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

Can you raise a support ticket for this?

2 replies

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
July 21, 2017

Can you raise a support ticket for this?

Alvaro_C_Author
Level 2
July 24, 2017

Sure,

The IT team has opened one.

Regards.