2.3.1 Overview of the batch application execution functionality
The batch application execution functionality is used for executing batch applications. A batch application is executed on batch loader provided with the batch application execution functionality. The contents output by the batch application that is being executed are output to the log output functionality.
The following figure shows the batch application execution functionality.
|
|
You can integrate the batch application execution functionality with the EJB access functionality and the resource connection functionality.
-
If you integrate the batch application execution functionality with the EJB access functionality, you can access EJB of other J2EE servers from a batch application.
-
If you integrate this functionality with the resource connection functionality, you can connect to a database from a batch application.
For details on the EJB access functionality, see 2.4.1 Functionality that you can use with EJB access and for details on the resource connection functionality, see 2.7 Resource connection functionality.
The following subsections describe life cycle of a batch application and a class loader that executes the batch application:
- Organization of this subsection
(1) Life cycle of a batch application
You use the cjexecjob command to start a batch application. The following figure shows the life cycle of a batch application.
|
|
-
If you execute the cjexecjob command, batch class loader loads a batch application.
-
The batch application is executed on a batch server.
-
The batch application processing ends.
After the batch application processing ends, GC occurs for the batch class loader that loaded the batch application.
-
Classes of the batch application are unloaded.
- Important note
-
A batch application is loaded to a batch class whenever you execute the cjexecjob command and the class is unloaded when processing is complete. We do not recommend that you operate a resident batch application on a batch server.
(2) State transition of a batch application
The following figure shows the state transition of a batch application.
|
|
RUNNING is a state that shows that the batch application is executing on a batch server.
You can confirm the state of a batch application from the batch application information. For details on how to display the batch application information, see 2.3.4 Displaying list of batch application information.
(3) Class loader executing a batch application
When executing a batch application, a class loader for the batch application is generated on the batch server. The batch application is executed on the class loader. The following figure shows the configuration of a class loader for batch applications.
|
|
The following subsections describe the above figure:
-
System class loader
A system class loader loads classes provided by the component software of Application Server and classes of the container extension library.
-
Timing of generation: When the J2EE server starts up
-
Timing of destruction: When the J2EE server stops
-
-
Connector class loader
A connector class loader loads the classes included in resource adapters. Only one connector class loader exists on a batch server.
-
Timing of generation: When the J2EE server starts up
-
Timing of destruction: When the J2EE server stops
-
-
Batch class loader
A batch class loader loads the classes included in a batch application. A context class loader of the thread, used for executing a batch application, is a batch class loader.
-
Timing of generation: When a batch application is executed
-
Timing of destruction: When the batch application ends
-
When a batch class loader is generated, a message stating that the batch class loader is generated is output (KDJE55013-I message). A message stating that end processing of the batch class loader is executed is also output (KDJE55014-I message).
For details on precautions to be taken for destroying class loader, see Appendix B.1 Configuring default class loader in the uCosminexus Application Server Common Container Functionality Guide. Properly read the class loader destruction timing and the message that is output when destroying the class loader.