User: patriot1burke
Date: 01/12/03 13:47:55
Modified: src/main/org/jboss/ejb/plugins Tag: Branch_2_4
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
No revision
No revision
1.10.2.6 +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.10.2.5
retrieving revision 1.10.2.6
diff -u -r1.10.2.5 -r1.10.2.6
--- AbstractInstanceCache.java 2001/11/27 04:25:11 1.10.2.5
+++ AbstractInstanceCache.java 2001/12/03 21:47:55 1.10.2.6
@@ -64,7 +64,7 @@
* @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="[EMAIL PROTECTED]">Scott Stark</a>
*
- * @version $Revision: 1.10.2.5 $
+ * @version $Revision: 1.10.2.6 $
*
* <p><b>Revisions:</b>
*
@@ -87,6 +87,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
@@ -202,6 +206,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