Exemplo n.º 1
0
    void DurRecoveryUnit::syncDataAndTruncateJournal() {
#if ROLLBACK_ENABLED
        invariant(_state != MUST_ROLLBACK);
        publishChanges();
#endif
        return getDur().syncDataAndTruncateJournal(_txn);
    }
Exemplo n.º 2
0
    bool DurRecoveryUnit::commitIfNeeded(bool force) {
#if ROLLBACK_ENABLED
        invariant(_state != MUST_ROLLBACK);
        publishChanges();
#endif
        _hasWrittenSinceCheckpoint = false;
        return getDur().commitIfNeeded(_txn, force);
    }
Exemplo n.º 3
0
    bool DurRecoveryUnit::awaitCommit() {
#if ROLLBACK_ENABLED
        invariant(_state != MUST_ROLLBACK);
        publishChanges();
        _state = NORMAL;
#endif
        return getDur().awaitCommit();
    }
Exemplo n.º 4
0
    void DurRecoveryUnit::commitUnitOfWork() {
        invariant(inAUnitOfWork());
        invariant(!_mustRollback);

        if (!inOutermostUnitOfWork()) {
            // If we are nested, make all changes for this level part of the containing UnitOfWork.
            // They will be added to the global damages list once the outermost UnitOfWork commits,
            // which it must now do.
            if (haveUncommitedChangesAtCurrentLevel()) {
                _startOfUncommittedChangesForLevel.back() = _changes.size();
            }
            return;
        }

        publishChanges();

        // global journal flush opportunity
        getDur().commitIfNeeded(_txn);
    }
Exemplo n.º 5
0
    void DurRecoveryUnit::commitUnitOfWork() {
#if ROLLBACK_ENABLED
        invariant(_state != MUST_ROLLBACK);
        invariant(_nestingLevel > 0);

        if (_nestingLevel != 1) {
            // If we are nested, punt to outer UnitOfWork. These changes will only be pushed to the
            // global damages list when the outer UnitOfWork commits (which it must now do).
            if (haveUncommitedChanges())
                _state = MUST_COMMIT;
            return;
        }

        publishChanges();
#endif

        // global journal flush
        getDur().commitIfNeeded(_txn);
    }
Exemplo n.º 6
0
    void DurRecoveryUnit::syncDataAndTruncateJournal() {
#if ROLLBACK_ENABLED
        publishChanges();
#endif
        return getDur().syncDataAndTruncateJournal(_txn);
    }