doc = (DocumentImpl) broker.openDocument(path, Lock.READ_LOCK);
doc = (DocumentImpl) broker.getXMLResource(path, Lock.READ_LOCK);
    public java.lang.String hasUserLock(java.lang.String sessionId, java.lang.String path) throws java.rmi.RemoteException {        DBBroker broker = null;		Session session = getSession(sessionId);		User user = session.getUser();        DocumentImpl doc = null;        try {            broker = pool.get(user);            doc = (DocumentImpl) broker.openDocument(path, Lock.READ_LOCK);            if (doc == null)                throw new EXistException("Resource "                        + path + " not found");            if(!doc.getPermissions().validate(user, Permission.READ))                throw new PermissionDeniedException("Insufficient privileges to read resource");            if (doc == null)                throw new EXistException("Resource " + path + " not found");            User u = doc.getUserLock();            return u == null ? "" : u.getName();        } catch (Exception ex) {        	throw new RemoteException(ex.getMessage());        } finally {            if(doc != null)                doc.getUpdateLock().release(Lock.READ_LOCK);            pool.release(broker);        }    }