[jboss-cvs] JBossAS SVN: r64864 - branches/JBoss_4_0_5_GA_CP07_JBAS-4611/tomcat/src/main/org/jboss/web/tomcat/tc5/session.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Aug 24 15:39:46 EDT 2007
Author: jiwils
Date: 2007-08-24 15:39:46 -0400 (Fri, 24 Aug 2007)
New Revision: 64864
Modified:
branches/JBoss_4_0_5_GA_CP07_JBAS-4611/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheWrapper.java
Log:
Fix for [JBAS-4611]. Cache eviction operations in JBCWrapper were reversed in order to prevent shutdown problems when cache loaders are used.
Modified: branches/JBoss_4_0_5_GA_CP07_JBAS-4611/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheWrapper.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP07_JBAS-4611/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheWrapper.java 2007-08-24 19:23:58 UTC (rev 64863)
+++ branches/JBoss_4_0_5_GA_CP07_JBAS-4611/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheWrapper.java 2007-08-24 19:39:46 UTC (rev 64864)
@@ -30,7 +30,7 @@
import java.util.Map;
import java.util.Set;
-public class JBossCacheWrapper
+public class JBossCacheWrapper
{
static final Option GRAVITATE_OPTION = new Option();
@@ -38,7 +38,7 @@
{
GRAVITATE_OPTION.setForceDataGravitation(true);
}
-
+
private static final int RETRY = 3;
private PojoCacheMBean proxy_;
@@ -234,22 +234,26 @@
}
throw new RuntimeException("JBossCacheService: exception occurred in cache evict after retry ... ", ex);
}
-
+
void evictSubtree(Fqn fqn)
{
-
+
Exception ex = null;
for (int i = 0; i < RETRY; i++)
{
try
{
+ // Test fix for JBAS-4611. The order of proxy_.evict and
+ // proxy_.getChildrenNames have been reversed on purpose.
+
+ // next do a depth first removal; this ensure all nodes
+ // are removed, not just their data map
+ Set children = proxy_.getChildrenNames(fqn);
+
// Evict the node itself first, since if it stores a Pojo
// that will do everything
proxy_.evict(fqn);
-
- // next do a depth first removal; this ensure all nodes
- // are removed, not just their data map
- Set children = proxy_.getChildrenNames(fqn);
+
if (children != null)
{
for (Iterator it = children.iterator(); it.hasNext(); )
@@ -257,11 +261,11 @@
Fqn child = new Fqn(fqn, it.next());
proxy_.evict(child);
}
-
+
proxy_.evict(fqn);
}
return;
-
+
}
catch (TimeoutException e)
{
@@ -273,8 +277,8 @@
}
}
throw new RuntimeException("JBossCacheService: exception occurred in cache evictSubtree after retry ... ", ex);
-
-
+
+
}
}
More information about the jboss-cvs-commits
mailing list