User development,
A new message was posted in the thread "How to limit the stateful SB pool
size?":
http://community.jboss.org/message/519955#519955
Author : Tony Bryan
Profile :
http://community.jboss.org/people/tonybryan
Message:
--------------------------------------------------------------
I'm trying to pick up the basics of EJB3 and JBoss. I'm following a tutorial that
demonstrates the stateful session bean lifecycle, forcing passivation and activation, by
limiting the pool of stateful session beans to one less than the number in use.
How is this achieved? With EJB3, can I write a +jboss.xml+ file as follows?
<
jboss>
<enterprise-beans >
<session>
<ejb-name>CountBean</ejb-name>
<configuration-name>Limited Poolsize Stateful
SessionBean</configuration-name>
</session>
</enterprise-beans>
<container-configurations >
<container-configuration extends=+"Standard Stateful
SessionBean"+>
<container-name>Limited Poolsize Stateful
SessionBean</container-name>
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
<cache-policy-conf>
<max-capacity>2</max-capacity>
</cache-policy-conf>
</container-cache-conf>
<container-pool-conf>
<MaximumSize>2</MaximumSize>
<strictMaximumSize>true</strictMaximumSize>
</container-pool-conf>
</container-configuration>
</container-configurations>
</jboss>
If I deploy the bean with this jboss.xml file in the META-INF folder then the bean works
but does not passivate and activate. Is my +jboss.xml+ file correct? Do I need to deploy
it somewhere else?
I found this post online:
http://community.jboss.org/message/515942#515942
If I follow the direction in this post, to instead modify the +ejb3-interceptors-aop.xml+
file, then I get the desired result, but this method is more complex and I haven't
read anything that says EJB3 doesn't suppor the jboss.xml file.
Can anyone confirm the simplest way to limit the pool of stateful session beans, both
generically, and on a per bean class basis?
Thanks!
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/519955#519955