Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Why ejbPassivate and ejbRemove are not called by weblogic container?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.??

<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>AdviceBeanStateful</ejb-name>
<stateful-session-descriptor>
<stateful-session-cache>
<max-beans-in-cache>2</max-beans-in-cache>
<idle-timeout-seconds>30</idle-timeout-seconds>
<cache-type>NRU</cache-type>
</stateful-session-cache>
</stateful-session-descriptor>
<jndi-name>headfirst/AdviceBeanStateful</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

-Andy
 
Shodhan Shah
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks
Shodhan
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....


Regards
Shriniwas
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic