1 Reply Latest reply on May 23, 2006 4:32 PM by upankar das

    Setting timeout for EJB call

    Radhakrishna Repala Newbie


      I am accessing an EJB(Ideally another AS(eg. weblogic)) from EJB deployed in Jboss AS, when the method is not returning for any reason I have to terminate the request. Is there any configuration specified by jboss to terminate the process after certain time period. I heared Weblogic is supporting this feature, I don't have any info about jboss.

      It's urgent requirement, any one can help me out.


        • 1. Re: Setting timeout for EJB call
          upankar das Newbie

          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-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-name>Stateless session bean</container-name>

          However, these will subject all your beans ( of that particular type) to the same time out setting.