-// private synchronized Session anonymousSession(HttpServletRequest request, Repository repository, String workspace) {
-// // TODO rather log in here as anonymous?
-// LoginContext lc = (LoginContext) request.getAttribute(NodeConstants.LOGIN_CONTEXT_ANONYMOUS);
-// if (lc == null)
-// throw new CmsException("No login context available");
-// // optimize
-// Session session;
-// try {
-// session = Subject.doAs(lc.getSubject(), new PrivilegedExceptionAction<Session>() {
-// @Override
-// public Session run() throws Exception {
-// return repository.login(workspace);
-// }
-// });
-// } catch (Exception e) {
-// throw new CmsException("Cannot log in to JCR", e);
+ public void releaseSession(Session session) {
+ JcrUtils.logoutQuietly(session);
+// if (cmsSessions.containsKey(session)) {
+// CmsSessionImpl cmsSession = cmsSessions.get(session);
+// cmsSession.releaseDataSession(alias, session);
+// } else {
+// log.warn("JCR session " + session + " not found in CMS session list. Logging it out...");
+// JcrUtils.logoutQuietly(session);