This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Guys I am running test set up on weblogic 8.1 for stateful session Beans. Test clients run fine. But for stateful session bean I am not able to passivate or remove the beans inspite of setting max-beans-in-cache ,idle-timeout-seconds(i.e. on Bean class ejbPassivate or ejbRemove methods are not invoked by container even after long time.).
I am usiing following configuration for weblogic-ejb-jar.xml. Can anyone tell why ejbPassivate and ejbRemove callbacks are not called by container though clients are idle for an hour.??
I am not a Weblogic expert but I would think that you cannot enforce an ejb passivation because this is up to the app server and is only done when the need arise due to resource constraints.
Joined: Apr 27, 2006
Andreas You are right that this depends on container implementation. But for this specific Weblogic container , here I found solution. There are two types of passivation. 1) lazy and 2) eager. We can choose by selecting cache type NRU -(lazy) or LRU - eager . I changed cache type and it worked.
Shodhan & Andy What you are saying is correct.Especially Shodhan, weblogic or any other server for that matter could provide you such facilities however this is not a Standard J2EE. To achive the same effect i would suggest you a simple solution which will work for all application servers & its as Simple as writing a Multithreaded client which will send say around 15+ request when you execute it. Make sure you keep <max-bean-in-cache> value as low as possible (value '2' will do)..If you are using evaluation copy of any app. sever there could be exception stating Can't create Instance etc....