How do I set the call timeout of an EJB function?

Asked

Viewed 178 times

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 accesses 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 set up the call timeout serviceImplRemote.userRequired() because the default timeout is too small and the processing of this function takes too long. Someone knows how to do this?

1 answer

1

Try to use the following annotation in the method that is taking:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.