The RemoverTask of the org.jboss.ejb.plugins.LRUStatefulContextCachePolicy performs removal of passivated beans based on a maxBeanLife - maxBeanAge diff. This is invalid for beans passivated due to size. The calculation should be maxBeanLife - (the per bean instance time of inactivity). The reason is a bean may be passivated very quickly due to cache size constraints and if the maxBeanLife - maxBeanAge == 0, just a quickly thrown away.
"ben wang" wrote:
Scott, I take it your proposal means that whenever maxBeanLife - passivationTime (time of passivation) == 0, we will remove the passivated bean, then? That means, in the usual case, a bean will exist in the container for the maximum time of (maxBeanLife +maxBeanAge).
Well, come to think of it, the fix is simple. But do we create a semantics change here? Let's say, maxBeanLife = maxBeanAge = 3600, then previously we expect the passivation happens one hour later. But with the new fix, it will be 2 hours!
Yes, I understand that but it is confusing already with these two variables (I mean what's difference between Life and Age??). And I think if we fix it now, it will create even more confusion.
Besides, we can get around this problem as long as maxBeanLife is greater maxBeanAge. It is slightly non-determinstic but I think it is still ok.
What do you think?