X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=server%2Fruntime%2Forg.argeo.server.jcr%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fjcr%2FThreadBoundJcrSessionFactory.java;h=193f22c48c99780e72af4c70a7956cab8ed07370;hb=cd50e3711d3b86921f11d9e021fc6a43bef0d400;hp=8adbae78486d2e158382f21c370c9c7d11c47879;hpb=01d5597f584ac37c81b5a9f6b3cdcf77a487c904;p=lgpl%2Fargeo-commons.git diff --git a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/ThreadBoundJcrSessionFactory.java b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/ThreadBoundJcrSessionFactory.java index 8adbae784..193f22c48 100644 --- a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/ThreadBoundJcrSessionFactory.java +++ b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/ThreadBoundJcrSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.argeo.jcr; import java.lang.reflect.InvocationHandler; @@ -66,9 +65,9 @@ public abstract class ThreadBoundJcrSessionFactory { public ThreadBoundJcrSessionFactory() { Class[] interfaces = { Session.class }; - proxiedSession = (Session) Proxy.newProxyInstance(getClass() - .getClassLoader(), interfaces, - new JcrSessionInvocationHandler()); + proxiedSession = (Session) Proxy.newProxyInstance( + ThreadBoundJcrSessionFactory.class.getClassLoader(), + interfaces, new JcrSessionInvocationHandler()); } /** Logs in to the repository using various strategies. */ @@ -134,13 +133,13 @@ public abstract class ThreadBoundJcrSessionFactory { if (activeSessions.size() == 0) return; - if (log.isDebugEnabled()) - log.debug("Cleaning up " + activeSessions.size() + if (log.isTraceEnabled()) + log.trace("Cleaning up " + activeSessions.size() + " active JCR sessions..."); deactivate(); for (Session sess : activeSessions.values()) { - sess.logout(); + JcrUtils.logoutQuietly(sess); } activeSessions.clear(); } @@ -172,8 +171,8 @@ public abstract class ThreadBoundJcrSessionFactory { Session session = activeSessions.get(thread.getId()); activeSessions.remove(thread.getId()); session.logout(); - if (log.isDebugEnabled()) - log.debug("Cleaned up JCR session (userID=" + if (log.isTraceEnabled()) + log.trace("Cleaned up JCR session (userID=" + session.getUserID() + ") from dead thread " + thread.getId()); }