Two-Phase Commit  Report

Throughout the two-phase commit experiment, tool will show a log window (or said Validation Output Window) to list the activities and the validation results. Let's review the process of the two-phase commit tool before we start to look into the log message.

    


When all the files provide by users are present, according to the figure above, there are 3 major steps shown below in order :

  1. Re-initiate the database: First the tool will clean the database that are going to use in this experiment. For example, if you define DB2 and Sybase in the database initiate file, tool will clean up those 2 database under specified account and then create the required tables and data according to your database initiate file.
  2. Load the Transaction Manager class and Application Program class(es): Secondly, class loader will dynamically load the TransactionManager class and ApplicationProgram class you provide. Then it will create the instance for each of the class.
  3. Run the two-phase commit experiment: After all the required class instances successfully created, the tool will do the following:
    • Run the registry process before the two-phase commit starts. (start from tx_begin())
    • First stage check: Check whether the implementation for registry is correct or not.
    • Start the two-phase commit (start from tx_commit())
    • Second stage check: Check the two-phase commit implementation is correct or not.

 After understanding the process of two-phase commit, it is the time to look at  the log message.

The first part of log is showing that the tool is doing the database re-initiating process.

 


Then the log shows that it is loading the TransactionManager and ApplicationProgram calss(es).


 


In this point, the tool starts to run the registry process.


First stage check:  tool checking the registry process right after previous step.

If your implementation is correct, you will see the "RM #n for Transaction #m registered properly". (n=RM id for the specified transaction. m=global transaction id.)

 

If your implementation is not correct, the tool will show the error and the possible mistake you made.


Then the two-phase commit is executed after the registry. This part of log is printed from the Transaction Manager class and you are the one implement it so you can print the customized message by yourself. For detail about how to use the logger please refer to "How can I log my own message in the log window?".

 


Then again, tool checks the two-phase commit implementation and show the suggest the mistake you might make if having any.

This is the correct implementation.

 

If the result does not match what should be, the error is shown.



Back to Help Contents