aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes how do we specify the max stateful beans in the pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how do we specify the max stateful beans in the pool" Watch "how do we specify the max stateful beans in the pool" New topic
Author

how do we specify the max stateful beans in the pool

Senthil Kumar
Ranch Hand

Joined: Mar 13, 2006
Posts: 264
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.


when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Georgy Bolyuba
Ranch Hand

Joined: Feb 18, 2005
Posts: 162
According to EJB 2.1 spec SFSB can be passivated after timeout. Try to play with container settings.


SCJP 1.4 (100%) Done.<br />SCJD (URLyBird 1.2.3 Started)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how do we specify the max stateful beans in the pool