1. Diseño de la investigación
4.4 Beneficios de la correcta asignación de costos por absorción
This subsection describes the functionality for monitoring a J2EE application during runtime, and the method timeout and method cancellation functionality that is provided by the J2EE runtime monitoring functionality.
! Important note
Due to the constraints in Java specifications and JavaVM implementation, in some cases you cannot cancel a method. In such cases, the area for which method cancellation cannot be performed is set as a special protected area that is not a class unit. If a method cannot be cancelled due to the constraints in Java specifications and JavaVM implementation, the following class name is displayed with detailed information for the message KDJE52718-W:
JP.co.Hitachi.soft.jvm.CriticalClass.dummy (Native Method) For details on the protected area, see 5.3.4(1) Protected area and non-protected area. The following table describes the organization of this section:
Table 5‒6: Organization of this section (Monitoring and canceling the execution time of the J2EE application during runtime)
Category Title Reference
Description Overview of monitoring and canceling the execution time of J2EE application 5.3.1 Monitoring the execution time of J2EE application 5.3.2
Method timeout 5.3.3
Method cancellation 5.3.4
Example of setting timeout value and the range of setting values 5.3.5
Thread count to be used 5.3.6
Implementation Definition in cosminexus.xml 5.3.7
Settings Settings for the execution environment 5.3.9 Operations Flow of monitoring and canceling the execution time of J2EE application 5.3.10
Confirming the execution status of a J2EE application 5.3.11 Canceling the request for which a timeout has occurred 5.3.12 The log information that is output by monitoring the execution time of J2EE
applications
5.3.13
Notes Precautions when implementing 5.3.8
5.3.1 Overview of monitoring and canceling the execution time of J2EE
application
If an infinite loop occurs internally in a J2EE application, you will not be able to control the operations of the J2EE application. For troubleshooting, set a timeout value in the runtime of the J2EE application such that the control is returned even if the process is not completed after a definite period.
You can use the following two types of functionality to specify such settings: • Method timeout functionality
• Method cancellation functionality
With the function, a timeout period can be set and monitored in each method of a J2EE application, and the timeout of requests that are not stopped within a fixed period can be detected (the method timeout function). Furthermore, if a
timeout occurs, a method can be canceled forcibly (the method cancellation function). At that time, transaction is also forcibly concluded. `You can set the method cancellation function such that it is executed automatically.
5.3.2 Monitoring the execution time of J2EE application
The functionality for monitoring the J2EE application execution time monitors the request execution time of the EJB and Web applications. If an error such as, infinite loop, is detected in the J2EE application through this functionality, the user can be notified by timing out the method process that did not terminate within the fixed time. You can also use the method cancellation functionality to terminate the transactions forcibly and cancel the methods that are in use. The functionality for monitoring the J2EE application execution time includes method timeout and method
cancellation functionality. Method timeout functionality
This functionality notifies the user by performing timeout of the method processing that did not terminate within a fixed time, from among the requests existing in the monitoring base. The monitoring base provides the interface required for implementing the functionality for monitoring the J2EE application execution time and manages the monitoring information.
Method cancellation functionality
This function cancels the method after timeout has been notified by the method timeout functionality. The transaction is also concluded forcibly when the database is being accessed at the time of cancellation. Note that in the method timeout and the method cancellation functionality, the thread dump is output as the log information. The number of thread dump files that are generated can be monitored by the resource depletion monitoring functionality. For the resource monitoring functionality, see 4. Monitoring Resource Depletion. The following figure shows the functionality for monitoring the J2EE application execution time:
Figure 5‒1: Overview of functionality for monitoring the execution time of J2EE application
The following points describe the commands in the above figure: • List display command
This command is used to confirm whether it is possible to execute the method cancellation command, before actually implementing it. For the list display command, see cjlistthread (display thread information) in the
uCosminexus Application Server Command Reference Guide. • Method cancellation command
This command is used when timeout is detected or when the thread status is invalid. For the method cancellation command, see cjstopthread (Deleting threads) in the uCosminexus Application Server Command Reference Guide.
• Command for forced termination of application
This command is used to terminate the application forcibly. For forced termination of applications, see 5.5 Stopping a J2EE application. For the command for forced termination of applications, see cjstopapp (Stopping J2EE applications) in the uCosminexus Application Server Command Reference Guide.
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.