This section explains the settings for method timeout in the J2EE application. The method timeout settings can help you to detect the occurrence of an infinite loop in the business processing on the Web container or EJB container, in Point 6 and Point 8. You can also forcibly cancel (method cancellation) the method that detected the timeout. For details about the method cancellation functionality, see 5.3.2 J2EE application execution time monitoring in the uCosminexus Application Server Operation, Monitoring, and Linkage Guide.
The following subsections explain the concept of setting the method timeout:
When method invocation is nested in the J2EE application, specify the order for invoking the method so that a higher value can be set as the timeout value at the invocation source.
An example of setup is given below:
Figure 8-14 Example of setup of method timeout
In this example, a high value is set for the method that is close to the invocation source. As a result, if timeout occurs somewhere in the method, timeout will occur sequentially from the method farthest from the client. The timeout is notified through a message. Depending on the settings, method cancellation can be automatically executed at this time.
If method timeout and method cancellation are set for the methods for executing remote invocation, you need to pay attention to the invocation order. In the method cancellation functionality, the methods that are being remotely invoked are considered to be running in the protected area. If timeout occurs first in the method closer to the invocation source, the method cannot be cancelled since the method is being remotely invoked. As shown in the above example, if you set a high value in the methods closer to the invocation source, since the timeout occurs sequentially from the methods farthest from the invocation source, the method in which timeout has occurred is not being remotely invoked. You can, therefore, definitely cancel the method.
Even if the method timeout and method cancellation are set for the methods for executing local invocation, you can integrate the timed-out method with the cancelled method by canceling sequentially from the methods farthest from the invocation source.
For details about the methods that can be used to set up the timeout value, see 5.3.4 Method cancellation in the uCosminexus Application Server Operation, Monitoring, and Linkage Guide.
Figure 8-15 Precautions in the case of nested invocation of a locally invoked method in the same thread