Transaction Management

4.1 Overview

4.1.2 Transaction State Changes

There are eight valid state changes allowed for the SET TRANSACTION command. Attempting to change transaction state to a state that is not allowed produces an error message of %RTR-E-INVSTATCHANGE, Invalid to change from current state to the specified state. The Table 6–19 table identifies the valid state changes.

Table 4–19 Valid Transaction State Transitions

 

 

 

NEW STATE

 

 

 

 

 

 

Current State

COMMIT

ABORT

EXCEPTION

DONE

 

 

 

 

 

SENDING

 

YES

 

 

VOTED

YES

YES

 

 

COMMIT

 

 

YES

YES

EXCEPTION

YES

 

 

YES

PRI_DONE

 

 

 

YES

 

 

 

 

 

Four typical situations are listed below where transaction state changes by the system administrator are allowed.

1.State SENDING changed to state ABORT.

The application server, after receiving a rtr_mt_msg_1 message and before calling rtr_accept_tx( ) for a particular transaction, experiences a ``hung'' situation and cannot proceed. Aborting this transaction with the SET TRANSACTION command is the only way to correct it. Internally, RTRACP will send the ABORT message to the router as well as the all participating servers to abort this transaction in a consistent matter.

2.State VOTED changed to state COMMIT.

This is the case where a application server running on the backend may have been separated from the rest of participating servers after casting the VOTE for the transaction. The other servers may have already committed the transaction but not ``forgotten'' it. As far as the application is concerned, this global transaction is committed and all changes have been committed to the underlying database on the different sites. However, the local transaction record is still in VOTED state in the RTR journal. You can use the command to manually commit the local transaction branch.

Note that this command is only applicable if there is no coordinating router running, i.e., servers are separated from the rest of the RTR network. If this is not the case, RTR rejects the command.

3.State VOTED changed to state ABORT.

In a similar manner to the VOTED-to-COMMIT situation described above, the server has been separated from the other participating servers and all other participants aborted this transaction; use this command to manually abort the local transaction branch.

Note that this command is only applicable if there is no coordinating router running and servers are separated from the rest of the RTR network. If this is not the case, RTR rejects the command.

4.State COMMIT changed to state DONE.

Transaction Management 4–3

Page 53
Image 53
Compaq AA-Q88CE-TE manual Transaction Management Overview Transaction State Changes, Valid Transaction State Transitions