Introduce Jackrabbit data model migration
[lgpl/argeo-commons.git] / server / runtime / org.argeo.server.jcr / src / main / java / org / argeo / jcr / JcrUtils.java
index c7915d0ed57bb89ed132419247c3eebc18037ff7..1cecd7100611744524da8e08296dbc49f00b935a 100644 (file)
@@ -167,7 +167,7 @@ public class JcrUtils implements ArgeoJcrConstants {
                buf.append('Y');
                buf.append(cal.get(Calendar.YEAR));
                buf.append('/');
-               
+
                int month = cal.get(Calendar.MONTH) + 1;
                buf.append('M');
                if (month < 10)
@@ -746,8 +746,13 @@ public class JcrUtils implements ArgeoJcrConstants {
 
        /** Logs out the session, not throwing any exception, even if it is null. */
        public static void logoutQuietly(Session session) {
-               if (session != null)
-                       session.logout();
+               try {
+                       if (session != null)
+                               if (session.isLive())
+                                       session.logout();
+               } catch (Exception e) {
+                       // silent
+               }
        }
 
        /** Returns the home node of the session user or null if none was found. */