User Input File Requirements

Application Program

You need to implement your own Application Program according to two-phase commit protocol.  The communication interfaces between Transaction Manager, Resource Manager and Application Program are revised from the X/Open standard. See the figure and description below (1),(3),(4) -the Blue color font are for the AP specially.

Figure 1 communication sequence between AP, TM and RM.

 

(1) : Ap first called tx_begin() through TM’s TX interface to gain the global transaction ID. 

(2): Then AP initiates its sub-transactions. Assuming that there are 2 subtrasactions  so AP has to call the native methods of RMproxy1 and RMproxy2 respectively. About what methods are available please refer to API for ResourceManager class.

(3): When RM proxy got the initialization request from AP, it will then call ax_reg() through TM’s AX interface to register itself to the TM.

(4): After all its sub-transactions successfully registering to TM, AP will call tx_commit() through TM’s TX interface and two phases commit protocol starts after this call.

(5):TM start to perform the two phases commit protocol and it communicate with RM(s) through the XA interface of RM(s).

The Application Program has to implement the APInterface  please refer the Class Diagram below.


Figure 2 Class Diagram

 

   File Name Restriction

The name of Application Program must be named ApplicationProgramN, N=0,1,2,.... and N must be in sequence.

For example, if you have 2 Application Program, then they must be named ApplicationProgram0.java and ApplicationProgram1.java. If you don't know follow this convention, the tool will complain it cannot find the supplied ApplicationProgram in that folder you provide.

   How to implement the Application Program ?

You must implement APInterface and fill the implementation for 4 methods - beginTransaction(), setupSubTransaction(), commitTransaction() and closeTransaction(). For detail description for this method, please refer to the API document.

   Sample File

The skeleton of Application Program is provided here.


Back to User Input File Requirements

Back to Help Contents