[jboss-cvs] JBossAS SVN: r65441 - in trunk/ejb3/src: main/org/jboss/ejb3/stateful and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Sep 18 04:28:35 EDT 2007
Author: wolfc
Date: 2007-09-18 04:28:34 -0400 (Tue, 18 Sep 2007)
New Revision: 65441
Modified:
trunk/ejb3/src/main/org/jboss/ejb3/cache/simple/SimpleStatefulCache.java
trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
trunk/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulBean.java
Log:
EJBTHREE-1016: fixed regression on nested passivation
Modified: trunk/ejb3/src/main/org/jboss/ejb3/cache/simple/SimpleStatefulCache.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/cache/simple/SimpleStatefulCache.java 2007-09-18 06:53:16 UTC (rev 65440)
+++ trunk/ejb3/src/main/org/jboss/ejb3/cache/simple/SimpleStatefulCache.java 2007-09-18 08:28:34 UTC (rev 65441)
@@ -214,6 +214,7 @@
else
{
centry.markedForPassivation = true;
+ assert centry.isInUse() : centry + " is not in use, and thus will never be passivated";
}
// its ok to evict because it will be passivated
// or we determined above that we can remove it
@@ -438,6 +439,10 @@
public void remove(Object key)
{
+ if(log.isTraceEnabled())
+ {
+ log.trace("Removing context " + key);
+ }
StatefulBeanContext ctx = null;
synchronized (cacheMap)
{
@@ -458,6 +463,8 @@
}
}
}
+// else
+// log.warn("Remove failed, context " + key + " was not found");
}
public int getCacheSize()
Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java 2007-09-18 06:53:16 UTC (rev 65440)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java 2007-09-18 08:28:34 UTC (rev 65441)
@@ -287,7 +287,10 @@
try
{
Thread.currentThread().setContextClassLoader(classloader);
- return getCache().create(initTypes, initValues).getId();
+ StatefulBeanContext ctx = getCache().create(initTypes, initValues);
+ // Since we return the key here, the context is not in use.
+ ctx.setInUse(false);
+ return ctx.getId();
}
finally
{
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulBean.java 2007-09-18 06:53:16 UTC (rev 65440)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulBean.java 2007-09-18 08:28:34 UTC (rev 65441)
@@ -84,10 +84,12 @@
public void lookupStateful() throws Exception
{
localStateful = (StatefulLocal)new InitialContext().lookup("StatefulBean/local");
+ log.info("lookup localStateful " + localStateful);
}
public void testStateful() throws Exception
{
+ log.info("get state of localStateful " + localStateful);
localStateful.getState();
}
More information about the jboss-cvs-commits
mailing list