OpenTP1 Version 7 Operation

[Contents][Index][Back][Next]

3.14.4 Action to take if an error occurs in the XAR file

If an I/O error occurs with the XAR file while the XA resource service is online, the XA resource service automatically swaps the online XAR file for the backup XAR file. This facility is called swapping. This facility allows nonstop operation of the XA resource service when there is a problem with the online XAR file.

You can use the swapping facility in the following ways:

If an I/O error occurs in an XAR file, the method to restart the online processing of the XA resource service differs depending on the file and the time the error occurs. The following shows the actions to take each time an error occurs.

  1. Use the swapping facility to swap the failed online XAR file with a new XAR file.
  2. After step 1, if an error occurs in the backup XAR file and the XA resource service is shout down, replace the failed backup XAR file with a new XAR file.
  3. If an error occurs in the online XAR file and OpenTP1 terminates, swap in a new XAR file.
  4. If an error occurs in both the online XAR file and the backup XAR file, the XAR resource service is shut down, and OpenTP1 stops, replace both XAR files with new ones.

The first and second methods involve replacing the XAR file that caused the error with a new XAR file without closing down OpenTP1. These methods allow the XA resource service to recover from shared memory the transaction branches that were present before the error occurred.

Since the first method involves measures that are implemented before any damage can occur to the backup XAR file, reliable operation of the XA resource service can be assured.

With the third method, even if OpenTP1 terminates, the XA resource service can access the information in the backup XAR file to recover the transaction branches that were present before the error occurred.

With the fourth method, OpenTP1 has terminated and both the online and backup XAR files have failed. Thus, swapping in a new XAR file does not allow the XA resource service to recover the transaction branches that were present before the error occurred.

Each method is described in detail below.

Organization of this subsection
(1) Swapping XAR files at failure of the online XAR file
(2) Swapping XAR files at failure of the backup XAR file
(3) Swapping XAR files at failure of the online XAR file with OpenTP1 not running
(4) Swapping XAR files at failure of the backup XAR file and with OpenTP1 not running

(1) Swapping XAR files at failure of the online XAR file

If an error occurs with the online XAR file, the XA resource service automatically swaps in the backup XAR file and continues uninterrupted operation. At this point, you can replace the failed online XAR file with a new file, allowing the transaction branches that were present before the error occurred to be recovered without having to shut down OpenTP1.

When the XA resource service is running using the backup XAR file, and you wish to replace the failed online XAR file with a new file, use the xarhold command to forcibly shut down the XA resource service. You will still be able to execute other OpenTP1 services.

To swap online XAR files at a failure:

  1. Execute the xarhold command.
    The XA resource service shuts down.
  2. Create a new online XAR file.
    Create this file on a different disk volume from that of the online XAR file that caused the error. Create the new online XAR file with the same record length and number of records as the backup XAR file.
  3. Update the definition for the online XAR file in the XA resource service definition, to reflect the XAR file you created.
    Only change the definition of the online XAR file.
  4. Execute the xarrles command.
    This releases the XA resource service from shutdown status. The transaction branches are recovered from shared memory, and the XA resource service resumes its online status using the newly created online XAR file.

The following figure shows how to swap XAR files when the online XAR file fails.

Figure 3-30 Swapping XAR files at failure of the online XAR file

[Figure]

(2) Swapping XAR files at failure of the backup XAR file

Any failure of the backup XAR file, swapped in to allow continuous operation following an error with the online XAR file, will cause the XA resource service to shut down. If this occurs, OpenTP1 responds with the error code XAER_RMERR to every transaction instruction from an application server linked by the XA resource service. However, since the error is localized to the XA resource service, OpenTP1 continues running, and you can continue to execute OpenTP1 services with the exception of the XA resource service. Once you replace the XAR files with new files, you can recover the transaction branches of the XA resource service.

To replace the XAR file when both the online XAR file and the backup XAR file have failed and the XA resource service has shut down:

  1. Create new XAR files.
    Create an online XAR file and a backup XAR file on a disk volume that is free from errors. These two files must have the same record length and number of records.
  2. Update the definition for the XAR files in the XA resource service definition, to reflect the XAR files you created.
    Change the definitions for both the online and backup XAR files.
  3. Execute the xarrles command.
    This releases the XA resource service from shutdown status. The transaction branches are recovered from shared memory, and the XA resource service resumes its online status using the newly created online XAR file.

The following figure shows how to swap XAR files when the backup XAR file fails.

Figure 3-31 Swapping XAR files at failure of the backup XAR file

[Figure]

(3) Swapping XAR files at failure of the online XAR file with OpenTP1 not running

If the online XAR file fails and OpenTP1 terminates (either normally or abnormally), the XA resource service shuts down. To restart the XA resource service, you create a new XAR file and then restart OpenTP1.

To replace the XAR file when the online XAR file fails and OpenTP1 has terminated:

  1. Create a new online XAR file.
    Create this file on a different disk volume from that of the online XAR file that has failed. The new online XAR file must have the same record length and number of records as the backup XAR file.
  2. Update the definition for the online XAR file in the XA resource service definition, to reflect the XAR file you created.
    Only change the definition of the online XAR file. Since the XA resource service recovers transaction branches from the backup XAR file, do not change the backup XAR file.
  3. Restart OpenTP1.
    When you restart OpenTP1, the shutdown status of the XA resource service is released. The transaction branches are recovered from the backup XAR file, and the XA resource service restarts, using the newly created online XAR file.

Note
Before you can start OpenTP1 normally, or restart it, I/O access to both the online and backup XAR files must be possible. You cannot start OpenTP1 with a failed XAR file.

The following figure shows how to replace the XAR file when the online XAR file fails and OpenTP1 has been terminated.

Figure 3-32 Swapping XAR files at failure of the online XAR file with OpenTP1 not running

[Figure]

(4) Swapping XAR files at failure of the backup XAR file and with OpenTP1 not running

If both the online and backup XAR files fail and OpenTP1 terminates (either normally or abnormally), the XA resource service shuts down. This means that the transaction branches that were present before the error occurred cannot be recovered. To restart the XA resource service, create new XAR files, and then forcibly start OpenTP1 (forced normal start).

To replace XAR files when both the online and backup XAR files fail and OpenTP1 has terminated:

  1. Create new XAR files.
    Create an online XAR file and a backup XAR file on a disk volume that is free from errors. These files should have the same record length and number of records.
  2. Update the definition for the XAR files in the XA resource service definition, to reflect the XAR files you created.
    Change the definitions for both the online and backup XAR files.
  3. Force OpenTP1 to start normally.
    When you restart OpenTP1, the shutdown status of the XA resource service is released. The XA resource service resumes its online status using the newly created online XAR file. However, transaction branches that were present before the error occurred are not recovered.

Note
Before you can forcibly start OpenTP1 normally, I/O access to both the online and backup XAR files must be possible. You cannot start OpenTP1 with a failed XAR file.

The following figure shows how to replace the XAR files when both the online and backup XAR files fail and OpenTP1 has terminated.

Figure 3-33 Swapping XAR files at failure of both the online and backup XAR files with OpenTP1 not running

[Figure]