| 115 | } |
| 116 | |
| 117 | void CnchProxyTransaction::syncTransactionStatus(bool throw_on_missmatch) |
| 118 | { |
| 119 | /// Call when remote query is done and when precommit the explicit transaction |
| 120 | auto expected_status = remote_client->getTransactionStatus(txn_record.txnID().toUInt64()); |
| 121 | if (throw_on_missmatch && expected_status != txn_record.status()) |
| 122 | { |
| 123 | throw Exception("Transaction " + txn_record.txnID().toString() + " status is not consistent with remote server, expected " + String(txnStatusToString(expected_status)) + ", got " + String(txnStatusToString(txn_record.status())), ErrorCodes::LOGICAL_ERROR); |
| 124 | } |
| 125 | setStatus(expected_status); |
| 126 | } |
| 127 | |
| 128 | void CnchProxyTransaction::setTransactionStatus(CnchTransactionStatus status) |
| 129 | { |
no test coverage detected