[jbosscache-commits] JBoss Cache SVN: r8468 - core/support-branches/3.2.7.GA_JBCACHE-1601/src/main/java/org/jboss/cache/interceptors.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Aug 18 20:07:46 EDT 2011


Author: dereed
Date: 2011-08-18 20:07:46 -0400 (Thu, 18 Aug 2011)
New Revision: 8468

Modified:
   core/support-branches/3.2.7.GA_JBCACHE-1601/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
Log:
[JBPAPP-7049] Backport JBCACHE-1601 to 3.2.7


Modified: core/support-branches/3.2.7.GA_JBCACHE-1601/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
===================================================================
--- core/support-branches/3.2.7.GA_JBCACHE-1601/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java	2011-08-19 00:05:26 UTC (rev 8467)
+++ core/support-branches/3.2.7.GA_JBCACHE-1601/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java	2011-08-19 00:07:46 UTC (rev 8468)
@@ -24,6 +24,7 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.InvocationContext;
 import org.jboss.cache.NodeSPI;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.commands.write.EvictCommand;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.interceptors.base.JmxStatsCommandInterceptor;
@@ -114,14 +115,15 @@
       }
       NodeSPI n = ctx.lookUpNode(fqn);
 
-      if (n != null)
-      {
-         return n.getDataDirect();
-      }
-      else
-      {
+      if (n == null)
          throw new NodeNotLoadedException();
-      }
+
+      // Fix JBCACHE-1601.  But NOT for OPTIMISTIC because of JBCACHE-1602
+      if (configuration.getNodeLockingScheme() != NodeLockingScheme.OPTIMISTIC
+&& !n.isDataLoaded())
+         throw new NodeNotLoadedException();
+
+      return n.getDataDirect();
    }
 
    private static class NodeNotLoadedException extends Exception



More information about the jbosscache-commits mailing list