| 46 | } |
| 47 | |
| 48 | void CnchExplicitTransaction::precommit() |
| 49 | { |
| 50 | /// Sync all transaction record; throw exception if status missmatch |
| 51 | std::for_each(secondary_txns.begin(), secondary_txns.end(), [](auto & txn) { |
| 52 | if (auto proxy_txn = txn->template as<CnchProxyTransaction>()) |
| 53 | proxy_txn->syncTransactionStatus(/*throw_on_missmatch=*/true); |
| 54 | }); |
| 55 | /// If a transaction fails, make sure that all parts metadata in bytekv of that txn is removed before commit |
| 56 | std::for_each(secondary_txns.begin(), secondary_txns.end(), [](auto & txn) { |
| 57 | if (txn->getStatus() == CnchTransactionStatus::Aborted) |
| 58 | txn->removeIntermediateData(); |
| 59 | }); |
| 60 | txn_record.prepared = true; |
| 61 | } |
| 62 | |
| 63 | TxnTimestamp CnchExplicitTransaction::commit() |
| 64 | { |
nothing calls this directly
no test coverage detected