Hitachi

uCosminexus Application Server Operation, Monitoring, and Linkage Guide


5.5.1 Terminating the J2EE application

Stopping a J2EE application means terminating the Web applications and Enterprise Beans that configure a J2EE application, and changing the status of the J2EE application so that the J2EE application does not accept requests from the client. This state is called termination. After this, the J2EE application stops on its own.

This section describes the types of J2EE application termination and the method of termination.

Organization of this subsection

(1) Types of J2EE application termination

The two types of J2EE application termination are as follows:

Normal termination

This is a method for terminating a J2EE application in daily operations. This method stops a Web application and Enterprise Bean in a J2EE application sequentially and stops the service safely. Note that when a request has been executed in the J2EE application, the J2EE application is not terminated until the request is finished. However, when normal termination is executed, you can set a timeout. If you have set a timeout, the control is returned to the client after a fixed period even if the J2EE application is not terminated.

In normal termination, at first the service is locked, then the reception of requests is stopped, and finally the J2EE application is terminated. Service lock means executing a request that has already been received and refusing a new request.

For example, in the following cases, if you want a planned termination for a J2EE application, first lock the service and then terminate the J2EE application:

  • When a service is provided only for a specific period throughout the day

  • When maintaining a system

Forced termination

This is a method for forcefully terminating a request without waiting for the request running in a J2EE application to finish. The resource that is being used is released by forced termination.

When an error occurs in the J2EE application and the control is not returned to the client, you can promptly terminate the service using forced termination.

Tip

You cannot perform forced termination of a J2EE application in the following cases:

  • When a statement cannot be canceled

    When a database is being operated and the processing of a running SQL is not returned, the statement is canceled. Statement cancel is the process of canceling the processing of a running SQL.

    However, depending on the resource adapter settings, system configuration, and the types of transactions being used, the statement may not be canceled. When a statement cannot be canceled, you cannot forcefully terminate a J2EE application in which the transaction with running SQL has timed out, and a J2EE application in which the SQL process has not returned.

    For statement cancellation, see 3.15.8 Transaction timeout and statement cancellation in the uCosminexus Application Server Common Container Functionality Guide.

  • When method cancellation cannot be executed

    On executing forced termination, the executing threads are interrupted at any unexpected place due to method cancellation. As a result, you cannot use method cancellation for a J2EE application with the shared data that is updated or deleted using the threads other than the threads targeted for method cancellation.

    For the configuration of J2EE applications for which method cancellation cannot be executed, see 5.3.4 Method Cancellation.

  • When 0 (zero) is set as the timeout value in the settings for de-activating the schedule queue used for undeploying a J2EE application in an environment with CTM

    When 0 is set as the timeout value of the process for de-activating the CTM schedule queue, locking by CTM does not finish until the request is complete. Therefore, you cannot terminate the J2EE application.

    For details, see 3.7.4 Locking and controlling requests for a schedule queue in the uCosminexus Application Server Expansion Guide.

(2) Termination methods

Execute normal termination and forced termination using the server management commands. For details on stopping a J2EE application, see 5.5 Stopping a J2EE application.

(3) J2EE application termination process flow

This section explains the J2EE application termination process flow. The following figure shows the process flow of normal termination and forced termination:

Figure 5‒12: Flow of J2EE application termination process

[Figure]

Lock process and termination process are implemented in the normal termination process.

The following sections explain lock process, termination process, and forced termination process.