code: public void onCloseSession(ExtendedSession session)
     {
        SessionImpl sessionImpl = (SessionImpl)session;
  
        int length = lockedNodes.size();
        if (length > 0)
        {
           String[] nodeIds = new String[length];
           lockedNodes.keySet().toArray(nodeIds);
  
           for (int i = 0; i < length; i++)
           {
              String nodeId = nodeIds[i];
              LockData lock = lockedNodes.remove(nodeId);
  
              if (lock.isSessionScoped() && !pendingLocks.contains(nodeId))
              {
                 try
                 {
                    NodeImpl node =
                       ((NodeImpl)sessionImpl.getTransientNodesManager()
                          .getItemByIdentifier(lock.getNodeIdentifier(), false));
  
                    if (node != null)
                    {
                       node.unlock();
                    }
  
                 }
                 catch (UnsupportedRepositoryOperationException e)
                 {
                    LOG.error(e.getLocalizedMessage());
                 }
                 catch (LockException e)
                 {
                    LOG.error(e.getLocalizedMessage());
                 }
                 catch (AccessDeniedException e)
                 {
                    LOG.error(e.getLocalizedMessage());
                 }
                 catch (RepositoryException e)
                 {
                    LOG.error(e.getLocalizedMessage());
                 }
              }
           }
           lockedNodes.clear();
        }
  
        pendingLocks.clear();
        tokens.clear();
  
        lockManager.closeSessionLockManager(sessionID);
     }
docs: {@inheritDoc}