| 244 | } |
| 245 | |
| 246 | Task<EmptyResult> Transaction::commit() { |
| 247 | if (UNLIKELY(readonly_)) { |
| 248 | // Prevent tools like admin_cli or fsck from mistakenly modifying data |
| 249 | XLOGF(CRITICAL, "disallow call commit on a read-only FDBContext!!!"); |
| 250 | EmptyResult result; |
| 251 | result.error_ = 1000; /* operation failed */ |
| 252 | co_return result; |
| 253 | } |
| 254 | co_return co_await EmptyResult::toTask(fdb_transaction_commit(tr_.get())); |
| 255 | } |
| 256 | |
| 257 | Task<EmptyResult> Transaction::onError(fdb_error_t err) { |
| 258 | co_return co_await EmptyResult::toTask(fdb_transaction_on_error(tr_.get(), err)); |
no test coverage detected