jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1504880 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java
Date Fri, 19 Jul 2013 13:56:00 GMT
Author: mduerig
Date: Fri Jul 19 13:56:00 2013
New Revision: 1504880

URL: http://svn.apache.org/r1504880
Log:
OAK-803: Backwards compatibility of long-lived sessions
log only once

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java?rev=1504880&r1=1504879&r2=1504880&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/SessionDelegate.java
Fri Jul 19 13:56:00 2013
@@ -65,6 +65,7 @@ public class SessionDelegate {
     private long updateCount = 0;
 
     private long lastAccessed = System.currentTimeMillis();
+    private boolean warnIfIdle = true;
     private boolean refreshAtNextAccess = false;
 
     /**
@@ -106,12 +107,13 @@ public class SessionDelegate {
             long timeElapsed = now - lastAccessed;
             // Don't refresh if this operation is a refresh operation itself
             if (!sessionOperation.isRefresh()) {
-                if (!refreshAtNextAccess
+                if (warnIfIdle && !refreshAtNextAccess
                         && timeElapsed > MILLISECONDS.convert(1, MINUTES)) {
-                    // Warn if this session has been idle too long
+                    // Warn once if this session has been idle too long
                     log.warn("This session has been idle for " + MINUTES.convert(timeElapsed,
MILLISECONDS) +
                             " minutes and might be out of date. Consider using a fresh session
or explicitly" +
                             " refresh the session.", initStackTrace);
+                    warnIfIdle = false;
                 }
                 if (refreshAtNextAccess || timeElapsed >= refreshInterval) {
                     // Refresh if forced or if the session has been idle too long



Mime
View raw message