| 564 | } |
| 565 | |
| 566 | void Document::commitTransaction() // NOLINT |
| 567 | { |
| 568 | if (isPerformingTransaction() || d->committing) { |
| 569 | if (FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) { |
| 570 | FC_WARN("Cannot commit transaction while transacting"); |
| 571 | } |
| 572 | return; |
| 573 | } |
| 574 | |
| 575 | if (d->activeUndoTransaction) { |
| 576 | // This will iterate over all documents and ask them to |
| 577 | // commit their transaction if their ID matches |
| 578 | GetApplication().commitTransaction(d->activeUndoTransaction->getID()); |
| 579 | } else { |
| 580 | const bool wasRecoveryWriteBlocked = transactionStateBlocksRecoveryWrite(*d); |
| 581 | d->bookedTransaction = 0; // Reset booked transaction even if it was not used |
| 582 | if (wasRecoveryWriteBlocked) { |
| 583 | signalBecameStable(*this); |
| 584 | } |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | bool Document::_commitTransaction(const bool notify) |
| 589 | { |