[jboss-cvs] JBossAS SVN: r92709 - branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/session.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Aug 23 12:56:12 EDT 2009


Author: bstansberry at jboss.com
Date: 2009-08-23 12:56:12 -0400 (Sun, 23 Aug 2009)
New Revision: 92709

Modified:
   branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheManager.java
Log:
[JBAS-7186] First cut at better handling of SuspectException during gravitation

Modified: branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheManager.java
===================================================================
--- branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheManager.java	2009-08-23 16:55:19 UTC (rev 92708)
+++ branches/Branch_5_x/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheManager.java	2009-08-23 16:56:12 UTC (rev 92709)
@@ -2017,6 +2017,7 @@
                {
                   ContextClassLoaderSwitcher.SwitchContext switcher = null; 
                   boolean doTx = false; 
+                  boolean loadCompleted = false;
                   try
                   {
                      // We need transaction so any data gravitation replication 
@@ -2052,6 +2053,8 @@
                                                                              : ClusteredSessionNotificationCause.FAILOVER;
                         session.notifyDidActivate(cause);
                      }
+                     
+                     loadCompleted = true;
                   }
                   catch (Exception ex)
                   {
@@ -2077,7 +2080,30 @@
                      try {
                         if(doTx)
                         {
-                           batchingManager.endBatch();
+                           try
+                           {
+                              batchingManager.endBatch();
+                           }
+                           catch (Exception e)
+                           {
+                              if (loadCompleted)
+                              {
+                                 // We read the data successfully but then failed in commit?
+                                 // That indicates a JBC data gravitation where the replication of
+                                 // the gravitated data to our buddy failed. We can ignore that
+                                 // and count on this request updating the cache.                               // 
+                                 log_.warn("Problem ending batch after loading session " + realId + " -- " + e.getLocalizedMessage() + " However session data was successful loaded.");
+                                 log_.debug("Failure cause", e);
+                              }
+                              else
+                              {
+                                 if (e instanceof RuntimeException)
+                                    throw (RuntimeException) e;
+                                 
+                                 throw new RuntimeException("loadSession(): failed to load session " +
+                                                            realId, e);
+                              }
+                           }
                         }
                      }
                      finally {




More information about the jboss-cvs-commits mailing list