Expand my Community achievements bar.

SOLVED

Every asset lock-unlock operation leaves an active session

Avatar

Level 2

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();

    }

}

1 Accepted Solution

Avatar

Correct answer by
Employee

Can you raise a support ticket for this?

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Can you raise a support ticket for this?

Avatar

Level 2

Sure,

The IT team has opened one.

Regards.