How do I configure the timeout of a function call from an EJB?

0

At the end of a service my project has a function that takes an EJB from another project that is installed on the same server, and access one of its functions.

My function that takes the EJB and accesses the function:

[...]

ServiceImplRemote serviceImplRemote = 
beanFactory.getBean("ServiceImplEJB",ServiceImplRemote.class);
Collection<UserDTO> result = 
serviceImplRemote.userRequired(**parametro da função**, **parametro da função**);
return result;

[...]

What I want to do is configure the timeout of the serviceImplRemote.userRequired() call because the default timeout is too small and processing this function takes too long. Does anyone know how to do this?

    
asked by anonymous 26.09.2018 / 16:10

1 answer

1

Try to use the next annotation on the method that is taking a long time:

    @AccessTimeout(value = 15, unit = TimeUnit.MINUTES)
    @Override
    public void metodoDemorado() {
        //implementação
    }
    
26.09.2018 / 19:17