User: patriot1burke
Date: 01/06/17 07:58:15
Modified: src/main/org/jboss/ejb/plugins EntityInstanceCache.java
Log:
Added key parameter to canPassivate(..) so that it
can verify that the object being passivated is really the
same object and hasn't already been freed then re-used.
Revision Changes Path
1.6 +14 -6 jboss/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java
Index: EntityInstanceCache.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- EntityInstanceCache.java 2001/06/13 18:48:56 1.5
+++ EntityInstanceCache.java 2001/06/17 14:58:14 1.6
@@ -20,7 +20,8 @@
* Cache subclass for entity beans.
*
* @author Simone Bordet ([EMAIL PROTECTED])
- * @version $Revision: 1.5 $
+ * @author <a href="[EMAIL PROTECTED]">Bill Burke</a>
+ * @version $Revision: 1.6 $
*/
public class EntityInstanceCache
extends AbstractInstanceCache
@@ -112,19 +113,26 @@
{
m_container.getInstancePool().free(ctx);
}
- protected boolean canPassivate(EnterpriseContext ctx)
+ /**
+ * (Bill Burke> added key parameter so that canPassivate
+ * can verify that the object being passivated is really the
+ * same object and hasn't already been freed then re-used.
+ */
+ protected boolean canPassivate(Object key, EnterpriseContext ctx)
{
if (ctx.isLocked())
{
// The context is in the interceptor chain
return false;
}
- else
+ else if (ctx.getTransaction() != null)
{
- if (ctx.getTransaction() != null)
- {
return false;
- }
+ }
+ // (Bill Burke)make sure we're passivating the right object!
+ else if (!((EntityEnterpriseContext)ctx).getCacheKey().equals(key))
+ {
+ return false;
}
return true;
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development