[jboss-cvs] JBossAS SVN: r67533 - in branches/JBPAPP_4_2_0_GA_CP/ejb3: src/main/org/jboss/ejb3/cache/tree and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 27 22:38:21 EST 2007


Author: bstansberry at jboss.com
Date: 2007-11-27 22:38:20 -0500 (Tue, 27 Nov 2007)
New Revision: 67533

Added:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree1136/
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136/
Modified:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java
Log:
[JBPAPP-453] StatefulTreeCache must clear the cache region in initialize()

Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml	2007-11-28 02:51:58 UTC (rev 67532)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml	2007-11-28 03:38:20 UTC (rev 67533)
@@ -3365,6 +3365,20 @@
 	        <include name="testlocal-service.xml"/>
 	     </fileset>
 	  </copy>
+
+    <jar jarfile="${build.lib}/ejbthree1136.jar">
+      <fileset dir="${build.classes}">
+          <include name="org/jboss/ejb3/test/ejbthree1136/DoNothing*.class"/>
+       </fileset>
+    </jar>
+    <jar destfile="${build.lib}/ejbthree1136.sar">
+       <metainf dir="${build.resources}/test/ejbthree1136">
+          <include name="jboss-service.xml"/>
+       </metainf>
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/ejb3/test/ejbthree1136/SFSB*.class"/>
+       </fileset>
+    </jar>
    </target>
    
    <target name="jars" depends="mdbsessionpoolclear, removedislocal, statelesscreation, defaultremotebindings, localfromremote, clusteredjms, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
@@ -4228,10 +4242,16 @@
                 value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=n,suspend=n"/>
          -->
       </antcall>
+      
       <antcall target="test-with-jvmargs" inheritRefs="true">
          <param name="test" value="ejbthree921"/>
          <param name="jvmargs" value=""/>
       </antcall>
+	   
+      <antcall target="test-with-jvmargs" inheritRefs="true">
+         <param name="test" value="ejbthree1136"/>
+         <param name="jvmargs" value=""/>
+      </antcall>
 
    </target>
 	

Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java	2007-11-28 02:51:58 UTC (rev 67532)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java	2007-11-28 03:38:20 UTC (rev 67533)
@@ -318,6 +318,9 @@
               config.maxSize());
       Region region = evictRegionManager.createRegion(cacheNode, element);
       
+      // JBCACHE-1136.  There's no reason to have state in an inactive region
+      cleanBeanRegion();
+      
       cache.registerClassLoader(cacheNode.toString(), cl);
       cache.activateRegion(cacheNode.toString());
       
@@ -359,17 +362,9 @@
       // Remove the listener
       cache.removeTreeCacheListener(listener);
 
-      try {
-         // Remove locally. We do this to clean up the persistent store,
-         // which is not affected by the inactivateRegion call below.
-         Option opt = new Option();
-      	 opt.setCacheModeLocal(true);
-         cache.remove(cacheNode, opt);
-      } 
-      catch (CacheException e) 
-      {
-         log.error("Stop(): can't remove bean from the underlying distributed cache");
-      }      
+      // Remove locally. We do this to clean up the persistent store,
+      // which is not affected by the inactivateRegion call below.
+      cleanBeanRegion();    
       
       try
       {
@@ -484,6 +479,20 @@
       return new Fqn(cacheNode, hashBuckets[index], beanId);
    }
    
+   private void cleanBeanRegion()
+   {
+      try {
+         // Remove locally.
+         Option opt = new Option();
+         opt.setCacheModeLocal(true);
+         cache.remove(cacheNode, opt);
+      } 
+      catch (CacheException e) 
+      {
+         log.error("Stop(): can't remove bean from the underlying distributed cache");
+      }       
+   }
+   
    /** 
     * Creates a RuntimeException, but doesn't pass CacheException as the cause
     * as it is a type that likely doesn't exist on a client.

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/ejbthree1136 (from rev 67532, branches/JBPAPP_4_2/ejb3/src/resources/test/ejbthree1136)

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136 (from rev 67532, branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1136)




More information about the jboss-cvs-commits mailing list