5.3.3 Method Timeout
The method timeout functionality performs timeout of the methods that do not terminate within a fixed time and notifies the same to the user.
- Organization of this subsection
(1) Determining a timeout and operations after the timeout
The timeout occurs when the invocation of the method monitored in the monitoring base satisfies the following formula:
Time-when-the-timeout-is-determined - Method-start-time > Timeout-time
You can select either of the following operations (Method cancellation mode) after the occurrence of timeout.
-
Output the KDJE52703-W message
-
Output the KDJE52703-W message and execute the method cancellation functionality
In both the cases, KDJE52716-I message is displayed when the timed out invocation terminates.
(2) Target processes of the method timeout functionality
Specify the timeout settings in the target processes of method timeout. The locations set are as follows:
-
Request process of the Web application
-
EJB method invocation process
Note that the following processes are not included in the scope of method timeout:
-
Processes operating when the J2EE applications are deployed and undeployed
-
Enterprise Bean processes operating in the status management functionality and the active session timeout functionality of the EJB container
Apart from the method invocation processes of the Enterprise Bean, the processes that the EJB container performs automatically as per the specified settings are not included in the scope of method timeout.
There are times when you cannot perform method timeout depending upon the data structure of the J2EE application. For details, see 5.3.8 Precautions When Implementing.
(3) Timeout detection interval and method timeout time
The following settings are required when using the method timeout functionality:
-
Time interval for detecting timeout
Specify the time interval for detecting the timeout.
The J2EE server checks after every fixed interval of time to determine whether timeout has occurred. This time is set for each J2EE server.
Moreover, as timeout detection is performed at fixed intervals, the maximum amount of time required for detection is as follows:
- Formula for calculating the time required for detecting the timeout
-
Time-taken-for-timeout-detection = Timeout-time + Interval-of-time-to-detect-timeout
-
Method timeout time for each J2EE application
Specify the time to be set as method timeout in the J2EE application.
The settings are made for each Enterprise Bean in the J2EE application or each Web application.
For details on the settings for monitoring the execution time of J2EE application, see 5.3.9 Settings for the execution environment.