Hi Ken,
I have a question about the passivation of entity beans.
The following steps are involved in this processing:
1) ready instances are cached.
2) if an instance matches the passivation criteria (idle time-out,
exceeding max pool size, etc.) it becomes a candidate for passivation.
3) if there are two or more candidates, they are passivated.
My question is, why "two" or more?
Why not one or more?
Or if you prefer doing it in batches, why not "8 or more"? (I believe 8
is used somewhere else in the EJB container).
The code this is happening in is:
v3\ejb\ejb-container\src\main\java\com\sun\ejb\containers\EntityContainer.java
See the body of the do-while loop in the internal class
ASyncPassivator's run() method:
int sz = passivationCandidates.size() - 1;
if (sz > 0) {
ctx =
(ComponentContext) passivationCandidates.remove(sz-1);
} else {
return;
}
Or could it have been a simple mistake (being double careful not to pass
a value that could lead to an IllegalArgumentException from the remove
method)? :)
I suppose the following would have been fine:
int sz = passivationCandidates.size();
Thanks,
Dies