Residential Batch
This chapter describes the concept of residential batch, the characteristics of architecture, creation of residential batch, and the testing and debugging process.
1. Overview
A residential batch is a batch designed to include a schedule management function in addition to the single session characteristics of a general batch.
General batch is a single session program and goes through the process of "performing → execution → end", whereas residential batch is carried out in the process of "performing → {repeat execution} → end". In other words, a residential batch is a batch designed to perform batches at specific cycle and intervals. In order to implement this residential batch requirement, the function of UCS server of Tmax is used. For information about Tmax UCS server, refer to Tmax Programming Guide(UCS).
Basic Structure
The following is a description of the features and components of a residential batch architecture.
-
Execution Interface
UCS residential batch executes server startup and shutdown using tmboot and tmdown commands, which are the server management tools of Tmax.
-
Residential Batch Server
As a server of Tmax, it performs initialization logic for database access, CommBuff, log, and global variables.
-
Providing work customization area using flow processing
-
Loop execution and schedule management
-
|
The components of the residential batch architecture are the same as some of the general batch architecture described in Basic Structure. This section describes the rest except for the same parts as the general batch architecture. |
2. Creating a residential batch
As mentioned in Batch Creation Process, the creation of a residential batch is largely divided into three steps of creating a resident batch server, creating a residential batch module, and confirming the creation of a residential batch.
The following is a detailed procedure.
-
Creating a residential batch server
-
Configuration for residential batch server
If you use the configuration of the residential batch server provided by ProFrame as it is, this step can be omitted.
-
Creating a residential batch server
-
-
Creating a residential batch module
-
Creating a residential batch module
-
-
Conforming a residential batch creation
-
Residential batch module test
-
Debugging
If an error occurs in the created residential batch module, the process of modifying the residential batch module is repeated until the error is resolved.
-
The following section describes how to create a resident batch.
2.1. Creating a residential batch
Configuration for residential batch Server
This section describes the WebAdmin access process in Creating a General Batch Server is partially omitted and only the procedure to check and set the configuration information related to the resident batch server.
The following is the procedure to check and set the configuration information related to the residential batch server in WebAdmin.
-
Select [CONFIG SYSTEM] > [CONFIG MANAGEMENT] > [ConfigMgmt] > [ConfigMgmt] in the WebAdmin screen.
-
When the ConfigMgmt screen appears, select 'COMPILE_CONFIG' in the ConfigGroup. These preferences can be customized to actual business processes.
Residential Batch Server ConfigurationThe following describes the configuration related to the residential batch module among the search result items in the figure above.
Item Description RESIDENT_UCS_BATCH_SERVER_COMPILE_BASE
Directory path where the residential batch server is compiled.
(Example: /compile/${resourceGroup}/src/batchServer/ucs/)
RESIDENT_UCS_BATCH_SERVER_HOME
Home directory path where the residential batch server is created.
(Example: /compile/${resourceGroup}/src/batchServer/ucs/)
RESIDENT_UCS_BATCH_SERVER_LIB_HOME
Library path for residential batch server.
(Example: /release)
RESIDENT_UCS_BATCH_SERVER_MAKE_FILE
Command to make the residential batch server.
(Example: make -f ${sourceFile}.mk)
RESIDENT_UCS_BATCH_SERVER_MAKE_FILE_HOME
Home directory path where the Make file of POD batch server is created. (Example: /compile/${resourceGroup}/src/batchServer/ucs/)
RESIDENT_UCS_BATCH_SERVER_SHELL_FILE
Shell file name of the POD batch server.
(Example: ${sourceFile}.sh)
RESIDENT_UCS_BATCH_SERVER_SHELL_FILE_HOME
Home directory path where the shell file of POD batch server is created. (Example: /compile/${resourceGroup}/src/batchServer/ucs/)
RESIDENT_UCS_BATCH_SERVER_SOURCE_HOME
Home directory path where the source file of POD batch server is created. (Example: /compile/${resourceGroup}/src/batchServer/ucs/)
RESIDENT_UCS_BATCH_SERVER_TEMPLATE_BASE
Home directory path where the template server source file of POD batch server is created. (Example: /compile/${resourceGroup}/src/batchServer/ucs/)
-
Check the 'Content' value of each configuration item among the search results, and modify it to the value to be changed.
-
Select the configuration item to change.
-
Check the selected configuration information.
-
After modifying the configuration information to be changed ('Use', 'Content', 'Description'), click [Save].
-
After inquiring the modified configuration items again, check the changed contents.
For more about WebAdmin, refer to ProFrame Administrator Guide.
-
Creating a Residential Batch Server
The following is an example of the procedure for creating a residential batch server.
-
After right-clicking in the workspace navigator, select [New] > [Server].
-
Following new server project dialog box appears. All items in this dialog are required to create a residential batch server.
Residential Batch Server – New Server Project Creation DialogThe following is a description of each item.
Item Description Server type
To create a POD batch server, select 'RESIDENT_UCS_BATCH'. For items not described in this section, refer to the general batch server creation part of Creating a General Batch Server.
-
After setting all required items in the new server project dialog box, click [Finish]. Then, a total of 3 files results from the creation of the residential batch server appear as follows:
Source File Name Description Server Source
Source file of residential batch server.
Make File
Make file of residential batch server.
Shell File
Shell file for executing the residential batch. Modify this file when a residential batch execution script is required.
Residential Batch Server – Source File Creation -
Before compiling the residential batch server, register the following items in the configuration file of the Tmax server. In this example, the sample.m file in the $TMAXDIR/config directory is changed to the tmconfig.m file and the UCSBATCH01 service is added.
*SERVER TPFMIPPR SVGNAME = svg1 BONL02CN SVGNAME = svg2 UONL01CN SVGNAME = svg1, SVRTYPE=UCS TPFMADM02 SVGNAME = svg1 TPFMADM03 SVGNAME = svg1 ### UCSBATCH server(Physical naem of UCS batch server) UCSBATCH01 SVGNAME = svg1, SVRTYPE=UCS PODBATCH01 SVGNAME = svg2, MIN=0, MAX=1, LIFESPAN=IDLE_0 QPSTEST SVGNAME = svg2 *SERVICE SPFMIPPR SVRNAME = TPFMIPPR TESTSVC01 SVRNAME = BONL02CN TESTSVC02 SVRNAME = BONL02CN PFMADMSVC31 SVRNAME = TPFMADM03 PFMADMSVC11 SVRNAME = TPFMADM02 POD_BAT01 SVRNAME = PODBATCH01 QPSTEST1 SVRNAME = QPSTEST QPSTEST2 SVRNAME = QPSTEST
-
To apply the residential batch server and service added to the tmconfig.m file to the Tmax server, execute the following.
[pfmtpqa@fwsol:/home2/pfmtpqa/proframe5.0/package/tmax/config]$ cfl -i tmconfig.m CFL is done successfully for node(tmconfig) [pfmtpqa@fwsol:/home2/pfmtpqa/proframe5.0/package/tmax/config]$ gst SVC tables are successfully generated GST is successfully done
-
Select the created residential batch server resource in the workspace navigator, right-click, and select [Compile Resource].
residential batch Server – Compile Resource -
When compile is complete, a residential batch server is created. The results are displayed in the directory containing the source files related to the residential batch.
[pfmtpqa@fwsol:/home2/pfmtpqa/proframe5.0/compile/team/src/batchServer/ucs]$ ls -al Total 92 drwxrwxrwx 2 pfmtpqa qa 512 Oct 7th 19:54 . drwxrwxrwx 5 pfmtpqa qa 512 Oct 7th 19:50 .. -rwxrwxrwx 1 pfmtpqa qa 38664 Oct 7th 19:54 UCSBATCH01 -rw-rw-rw- 1 pfmtpqa qa 2558 Oct 7th 19:52 UCSBATCH01.c -rwxrwxrwx 1 pfmtpqa qa 1449 Oct 7th 19:52 UCSBATCH01.mk -rwxrwxrwx 1 pfmtpqa qa 76 Oct 7th 19:52 UCSBATCH01.sh
File Name Description UCSBATCH01
Created residential batch server.
UCSBATCH01.c
Source file of created residential batch server.
UCSBATCH01.mk
Make file of created residential batch server.
UCSBATCH01.sh
Shell file of created residential batch.
The created batch server must be copied to the APPDIR set in the Tmax configuration file, which is the directory that loads the server of Tmax (the default directory of Tmax configuration is $TMAXDIR/appbin).
2.2. Creating a Residential Batch Module
Creating a Residential Batch Module
The process of creating a residential batch module is the same as the process of creating a general batch module. However, if the resident batch is defined by changing some properties of the batch module in the EMB Designer built into the studio, the developer or batch manager can define the desired POD batch. This section describes the process of designing the residential batch in EMB Designer.
To create a residential batch module, design a residential batch using the EMB Designer built into the studio.
The following is an example of the process of creating a residential batch module.
-
Right-click on the workspace navigator and select [New] > [EMB Batch Design], then the new batch module creation dialog box appears as follows:
Residential Batch Module – Create a New Batch Flow Module Dialog -
After setting all basic information for residential batch module creation in the new batch module creation dialog box, click [Finish] to move to the EMB Designer screen where you can design the residential batch module.
Residential Batch Module – Batch DesignThe process of creating and designing a residential batch module is the same as the method of creating a service module of an online service. For more about creating an online service module, refer to ProFrame EMB Developer Guide.
-
As mentioned in Creating a Residential Batch Module, a resident batch module is created by changing the 'Batch Kind' and 'Schdl sec' properties for a batch module designed like Residential Batch Module – Batch Design.
Property Description Batch Kind
Changes 'G: Normal type' to 'U: UCS type'.
Schdl sec
Enter the schedule time in seconds for the residential batch.
You can enter up to microseconds. For example, you can enter 5.5 seconds or 5.005 seconds. However, please note that input in units of less than 0.005 seconds may not work depending on the UNIX server environment.
Residential Batch Module – Batch Kind and Schdl sec Property Change
Unlike the general batch module, the residential batch module has a different purpose of using the batch module item in the [Palette] menu of the EMB Designer in the studio. The general batch is a Tmax client program and a POD batch is a Tmax server program.
| Module | Description |
|---|---|
General batch |
Tmax client program, which can control the XA transaction with and cannot connect to itself as an XA. |
POD batch |
Tmax server program,which not only controls the XA transaction, but also binds itself to the XA transaction for an access. |
|
For more details, refer to Tmax Application Development Guide. |
In POD batch, the TX-related API is used to manage the transactions of one’s own server with other XA services that are linked in the case of a POD server as "1-transaction". If the POD server is NON-XA, it is used only for the purpose of controlling the transactions of other XA services that are connected.
Database-related APIs in POD batch cannot be used in POD XA server, whereas POD NON-XA server can be used, and can control only the transactions of its database.
2.3. Conforming Residential Batch Creation
Residential Batch Module Test
Residential batch server is started or stopped using the tmboot and tmdown commands, which are the Tmax server management programs. When the residential batch server is started, it executes the residential batch program, stops it for the specified schedule time, and then executes the residential batch program again. The process of executing the residential batch program continues until the residential batch server is shut down with the “tmdown -S [batch server name]” command.
In this example, the residential batch module is tested using the tmdown command as follows:
[pfmtpqa@fwsol:/home2/pfmtpqa/proframe5.0]$ tmboot -S UCSBATCH01 -o "-c UCS_BAT01"
TMBOOT for node(fwsol) is starting:
Welcome to Tmax demo system: it will expire 2009/01/01
Today: 2008/10/7
TMBOOT: SVR(UCSBATCH01) is starting: Tue Oct 07 21:45:13 2008
[pfmtpqa@fwsol:/home2/pfmtpqa/proframe5.0]$ tmdown -S UCSBATCH01
In ProFrame that reflects RI/WS, when calling the batch module created in WorkSpace, export the following phrase and reboot the server to test.
### When calling a batch module in the Work Space area export PFM_WS_DLCALL_YN=Y ### When calling a batch module in the Release Image area export PFM_WS_DLCALL_YN=N
The UCS batch process loads the environment of tmboot, so after exporting the RI/WS CALL option, you need to work with the following command.
tmdown -S [POD batch server name] tmboot -S [POD batch server name]
Debugging Residential Batch
If debugging is required after testing the residential batch module, check the batch log file. The batch log file is located in the directory set in the environment variable of PFM_BAT_LOG_DIR and is created as “[batch server name]_bat_yyyymmdd.log”.