Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do we specify the max stateful beans in the pool

 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i am trying the simulate the scenario where ejbActivate() and ejbPassivate() would be triggered.i am using weblogic8.1.
my weblogic-ejb-jar.xml goes like this.

<weblogic-ejb-jar>
<weblogic-enterprise-bean >
<ejb-name>Second</ejb-name>
<stateful-session-descriptor>
<stateful-session-cache>
<max-beans-in-cache>2</max-beans-in-cache>
</stateful-session-cache>
</stateful-session-descriptor>
<jndi-name>myEJB</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>

And i am creating the remote objects thrice.As per my descriptor(the max bean in the pool is 2),passivation must happen.
But that is not happening.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually stateful Session Beans are not pooled, the exist only for one client. So when the client first looks up a Stateful bean, one gets created, not taken from any pool, and when the client is finished the bean gets destroyed.

Mark
 
Georgy Bolyuba
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to EJB 2.1 spec SFSB can be passivated after timeout. Try to play with container settings.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic