User: patriot1burke
Date: 01/12/03 14:04:29
Modified: src/main/org/jboss/ejb/plugins AbstractInstanceCache.java
Log:
Added a little defensive coding.
Make sure that the ctx.getId() returned from unschedulePassivation is NOT null.
I just debugged this behavior in JBoss 2.2.x running in a production system and
want to make sure that it doesn't creep up in later versions. BTW, I could not
find the source of the problem in JBoss 2.2.x
Revision Changes Path
1.25 +12 -1 jboss/src/main/org/jboss/ejb/plugins/AbstractInstanceCache.java
Index: AbstractInstanceCache.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractInstanceCache.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- AbstractInstanceCache.java 2001/11/27 04:23:16 1.24
+++ AbstractInstanceCache.java 2001/12/03 22:04:29 1.25
@@ -61,7 +61,7 @@
* @author <a href="[EMAIL PROTECTED]">Bill Burke</a>
* @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
*
- * @version $Revision: 1.24 $
+ * @version $Revision: 1.25 $
*
* <p><b>Revisions:</b>
*
@@ -84,6 +84,10 @@
* <ol>
* <li>releaseLockRef should be enclosed in peek in remove()
* </ol>
+ * <p><b>2001/12/03: billb</b>
+ * <ol>
+ * <li>Make sure ctx.getID() is non-null when received from unschedulePassivation.
+ * </ol>
*/
public abstract class AbstractInstanceCache
implements InstanceCache, XmlLoadable, Monitorable, MetricsConstants
@@ -198,6 +202,13 @@
// Here I block if the bean is passivating now
ctx = unschedulePassivation(id);
+ // A little defensive coding here.
+ // ctx.getId() == null means that the ctx was ejbRemoved
+ if (ctx != null && ctx.getId() == null)
+ {
+ log.warn("unschedulePassivation returned a passivated object with a
null getId(), this ctx will NOT be reused");
+ ctx = null;
+ }
// Already passivated ?
if (ctx == null)
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development