• No results found

(3) Precautions when executing the lock process

It is necessary to take care of the following points when executing the lock process: (a) Precautions when using CTM

You must take the following precautions for executing the lock process, when CTM is used:

• When the Web application or EJB use CTM to access the EJB present in the same J2EE application When the lock process finishes, even the requests that are being processed throw an exception to the client. In such cases, terminate the processing of the client that invokes the applicable Web application or EJB, and then stop the J2EE application.

• When a request is entered without using CTM for EJB invoked from CTM after the lock process New request is received since the EJB lock process is not implemented. In such cases, stop the processing of the client that invokes the applicable EJB, and then stop the J2EE application.

• When 0 is specified in the ejbserver.ctm.DeactivateTimeOut key of usrconf.properties

In usrconf.properties, do not specify 0 in the ejbserver.ctm.DeactivateTimeOut key. If 0 is specified and an attempt is made to stop the application when a request is being processed via CTM, the lock process does not end until the request is complete. Therefore, if the request is incomplete due to failure, you cannot execute the forced termination.

(b) Precautions when invoking Web applications across J2EE applications

In a Web application, you can use getContext of javax.servlet.ServletContext and access a Web application on the same Web container. When the Web application to be accessed is deployed on another J2EE application, first stop the J2EE application that includes the calling front-end Web application.

5.5.3 Stop process

The stop process is implemented in the following order: 1. Stop process of the J2EE application

2. Undeploy process of the J2EE application. The following points describe each process:

(1) Stop process

The stop process is implemented in the following order. Note that the J2EE application cannot be executed after the process ends.

1. Processing to stop the Web application 2. Processing to stop EJB

3. Processing to stop the J2EE application The following points describe each process: (a) Processing to stop the Web application

The stop process of Web application is implemented in the following order: 1. Processing to end the servlet or JSP

The destroy method of servlet and the jspDestroy method of JSP is executed. 2. Destroying the HTTP session

The HTTP session attributes are deleted and disabled. 3. Processing to end the filter

The destroy method of filter is executed. 4. Destroying the servlet context

The servlet context attributes are destroyed and disabled.

5. Deleting the execution environment of the Web application from the name space ejb-ref, ejb-local-ref, resource-ref, env-entity, etc., are deleted from the name space. (b) Processing to stop EJB

The stop process of EJB is implemented in the following order: 1. Deleting the execution environment of EJB from the name space

ejb-ref, ejb-local-ref, resource-ref, env-entity, etc., are deleted from the name space. 2. Deleting the EJB home object or the EJB local home object from the name space

The EJB home object or the EJB local home object is deleted from the name space. 3. Deleting the pool

The method-ready pool is deleted in the case of Session Bean and Message-driven Bean. The pool and ready pool are deleted in the case of Entity Beans.

(c) Processing to stop the J2EE application

The entries of the J2EE application are deleted from the name space in the stop process of the J2EE application.

(2) Un-deploy process

The un-deploy process is implemented in the following order. Note that the J2EE application is deleted from the J2EE server after the process ends.

1. Processing to un-deploy the Web application 2. Processing to un-deploy EJB

3. Processing to un-deploy the J2EE application The following points describe each process: (a) Processing to un-deploy the Web application

Java source files and class files that are the JSP compilation results are deleted during the un-deploy process of the Web application. For JSP compilation results, see 2.5.6 JSP compilation results when JSP pre-compile is not used in the uCosminexus Application Server Web Container Functionality Guide.

(b) Processing to un-deploy EJB

The un-deploy process of EJB is implemented in the following order: 1. Deleting the remote adapter (only when the remote interface is supported) 2. Deleting the table created when CMR is used

(c) Processing to un-deploy the J2EE application

The files downloaded manually by the user are deleted in the un-deploy process of the J2EE application.

5.5.4 Forced termination process

In the forced termination process, the lock process and stop process are not executed for the normal termination. The process is cancelled forcibly even when there is a request that is being processed in the J2EE application. Note that a method being executed is cancelled.

Handling the transaction when a J2EE application is terminated forcibly

When a J2EE application is forcibly terminated, the transaction that is about to be performed is timed out forcibly. As a result, an exception occurs and the transaction cannot be started if you try to start the transaction after the J2EE application is terminated forcibly.

However, when the in-process OTS is running across multiple JavaVM, the transaction is not timed out forcibly even when the J2EE application is terminated forcibly.

Furthermore, if an SQL statement is being executed in Statement, CallableStatement, or PreparedStatement when the J2EE application is terminated forcibly, the execution is cancelled and the control tends to return to the J2EE application. The connection used in the J2EE application is destroyed and does not return to the pool.

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

5.5.5 Definition in cosminexus.xml

This subsection describes the definitions in cosminexus.xml required in the application development environment.

Specify the definition for using the forced termination functionality of a J2EE application in the <front-ejb> tag under the <session>, <entity>, or <message> tags of cosminexus.xml.

For details on the tags to be specified, see 2.2 Details of each property specified in the Cosminexus application property file (cosminexus.xml) in the uCosminexus Application Server Application and Resource Definition Reference Guide.

5.5.6 Settings for execution environment

When using the functionality for J2EE application operations, you must specify settings for the J2EE server and J2EE applications.

(1) Setting J2EE servers

To use the functionality for J2EE application operations, you must specify settings for the J2EE server. Implement the J2EE server settings in the Easy Setup definition file. Specify the definition of the functionality for J2EE application operations in the <configuration> tag of the logical J2EE server (j2ee-server) in the Easy Setup definition file. Table 523: Definitions required for the functionality for J2EE application operations

Items Parameter to be specified Setting contents

Forced termination of a

J2EE application ejbserver.deploy.app.stopforcibly.disabled#1

Specifies whether to use the forced termination functionality of the J2EE application.

Items Parameter to be specified Setting contents Forced termination of a

J2EE application ejbserver.deploy.app.stopforcibly.disabled#1

If the front-end (element that forms the request socket from the client perspective) of the J2EE application is an Enterprise Bean, use the server management command to specify the front Enterprise Bean (Front EJB). For details on the settings for using the server management commands to forcibly terminate a J2EE application, see (2)Setting the J2EE applications.

Monitoring the execution time of J2EE application

ejbserver.ext.method_obse rvation.interval#2

Specifies whether to use the functionality for monitoring the execution time of J2EE application , the time interval for checking whether the processing of the request has timed out, and the time interval for canceling a timed out request (method).

Specify the value for method timeout and the method cancellation mode. This value will be used in the functionality for monitoring the execution time of J2EE application runtime using the server management commands.

For detailed settings, see 5.3.9(2) Setting for J2EE applications. #1

Specify this parameter in the JavaVM system properties of the J2EE server in the Easy Setup definition file. #2

Specify this parameter in the user properties of the J2EE server in the Easy Setup definition file.

For details on the Easy Setup definition file and the parameters to be specified, see 4.6 Easy Setup definition file in the

uCosminexus Application Server Definition Reference Guide.