-
1. Re: Setting timeout for EJB call
upankar May 23, 2006 4:32 PM (in response to radhirepala)All EJB by default use JRMP invoker where there is no timeout configuration that can be done. For that to happen, you need to use PooledInvoker and set the SocketTimeOut attribute of it. Below is how you need to do it ...
1] Firstly, edit the jboss-service.xml to set the SocketTimeout attribute in the following element
<mbean code="org.jboss.invocation.pooled.server.PooledInvoker" ......>
2] Second, edit standardjboss.xml and copy any <invoker-proxy-binding> element in it and change the to any name that u want ( For example, stateless-pooled-invoker ), and the <invoker-mbean> to refer to the pooled invoker which is "jboss:service=invoker,type=pooled". So this invoker-proxy-binding will look like as below
<invoker-proxy-binding>
stateless-pooled-invoker
<invoker-mbean>jboss:service=invoker,type=pooled</invoker- mbean>
3] Now find the <container-configuration> element in the same standardjboss.xml for the EJB type (stateless, stateful, entity) desired, and change <invoker-proxy-binding-name> to have the one you just created as shown below
<container-configuration>
<container-name>Stateless session bean</container-name>
<call-logging>false</call-logging>
<invoker-proxy-binding-name>stateless-pooled-invoker</invoker-proxy-binding-name>
..................
..................
</container-configuration>
However, these will subject all your beans ( of that particular type) to the same time out setting.