25.3. Transaction Recovery
25.3.1. Transaction Recovery Process
Procedure 25.3. The Transaction Recovery Process
- The Transaction Manager creates a list of transactions that require intervention.
- The system administrator, connected to JBoss Data Grid using JMX, is presented with the list of transactions (including transaction IDs) using email or logs. The status of each transaction is either
PREPARED. If some transactions are in both
PREPAREDstates, it indicates that the transaction was committed on some nodes while in the preparation state on others.
- The System Administrator visually maps the XID received from the Transaction Manager to a JBoss Data Grid internal ID. This step is necessary because the XID (a byte array) cannot be conveniently passed to the JMX tool and then reassembled by JBoss Data Grid without this mapping.
- The system administrator forces the commit or rollback process for a transaction based on the mapped internal ID.
25.3.2. Transaction Recovery Example
Example 25.2. Money Transfer from an Account Stored in a Database to an Account in JBoss Data Grid
TransactionManager.commit()method is invoked to run the two phase commit protocol between the source (the database) and the destination (JBoss Data Grid) resources.
TransactionManagertells the database and JBoss Data Grid to initiate the prepare phase (the first phase of a Two Phase Commit).