GlassFish v2.1.1の追加機能のメモ
http://wiki.glassfish.java.net/Wiki.jsp?page=PlanForGlassFishV2.1.1
New load-balance option for stateless session beans
A new method for load-balancing stateless EJBs is introduced in GlassFish v2.1.1.
This provides for load-balancing with each request. Per-request load balancing
chooses the first node in the cluster to use on each request.
The old load balancing feature chooses the first node to use when the InitialContext is created;
thereafter each request uses the same node (unless a failure occurs).
Enabling this feature is done by setting a new property in the sun-ejb-jar.xml file:
per-request-load-balancing (boolean). If this property is not set,
the original Load Balance behavior is preserved.
For example:
<sun-ejb-jar>
<enterprise-beans>
<unique-id>1</unique-id>
<ejb>
<ejb-name>TheGreeter</ejb-name>
<jndi-name>greeter</jndi-name>
<per-request-load-balancing>true</per-request-load-balancing>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
After this is set, you must redeploy the EJB(s).
As a verification check, you can verify that this is configured properly
by looking for the following (FINE, in the EJB logger) log message
when the EJB is loaded:
“Setting per-request-load-balancing policyfor EJB <EJBNAME>”
This is only supported for stateless session beans.
Use of per-request-load-balancing with any other bean types will
result in a deployment error.
Entry filed under: Application Server/GlassFish. Tags: GlassFish.