Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

void Log_Transaction::UpdateUndoRedoInfoForRestart ( const Log_IOSequenceNo  oldestKnownIOSeq  ) 

updates undo/redo information from the Undo/Redo-files

Parameters:
oldestKnownIOSeq the oldestKnownIOSequence of this transaction

Definition at line 2131 of file Log_Transaction.cpp.

References Allocator(), destroy(), Log_UndoFile::GetLastEntrySequence(), Rst_RedoFile::GetLastEntrySequence(), Log_UndoFile::Invalidate(), Data_BaseFile::IsCreated(), IsInitializedForRedoCopy(), Log_Transaction::Persistent::LastCopiedRedoEntrySequence, Rst_RedoFile::LastPageNo(), Log_UndoFile::LastPageNo(), Log_Transaction::Persistent::LastRedoEntrySequence, Log_Transaction::Persistent::LastUndoEntrySequence, LogTrans_Trace, m_Context, m_OldestKnownIOSequence, m_pRedoFile, m_pTrans, m_pUndoFile, Log_Transaction::Persistent::RedoFileLastPageNo, Log_Transaction::Persistent::UndoFileLastPageNo, and Log_Transaction::Persistent::UndoFileRootPageNo.

Referenced by Rst_RedoReadTask::ReCreateOpenTransactions().

{
    SAPDBTRACE_METHOD_DEBUG ("Log_Transaction::UpdateUndoRedoInfoForRestart", LogTrans_Trace, 5);

      SAPDBERR_ASSERT_STATE ( IsInitializedForRedoCopy() );
    
    m_pUndoFile = new (Allocator()) Log_UndoFile ( *m_pTrans,
                                                   m_Context.UndoFileRootPageNo,
                                                   m_Context.UndoFileLastPageNo );
    if ( m_pUndoFile == NULL )
        RTE_Crash( SAPDBErr_Exception(__FILE__, __LINE__,
                   SAPDBERR_ASSERT_STATE_FAILED,
                   "allocation of Log_UndoFile failed") );

    #ifdef SAPDB_QUICK
    if ( m_pUndoFile->IsCreated() )
    {
        Kernel_VTrace() << "UpdateUndoRedoInfoForRestart: UndoFileLastPageNo "
                        << m_Context.UndoFileLastPageNo << " -> "
                        << m_pUndoFile->LastPageNo() << FlushLine;
        Kernel_VTrace() << "UpdateUndoRedoInfoForRestart: LastUndoEntrySequence "
                        << m_Context.LastUndoEntrySequence << " -> "
                        << m_pUndoFile->GetLastEntrySequence() << FlushLine;
    }
    if ( m_pRedoFile->IsCreated() )
    {
        Kernel_VTrace() << "UpdateUndoRedoInfoForRestart: RedoFileLastPageNo "
                        << m_Context.RedoFileLastPageNo << " -> "
                        << m_pRedoFile->LastPageNo() << FlushLine;
        Kernel_VTrace() << "UpdateUndoRedoInfoForRestart: LastCopiedRedoEntrySequence "
                        << m_Context.LastRedoEntrySequence << " -> "
                        << m_pRedoFile->GetLastEntrySequence() << FlushLine;
    }
    #endif
    
    if ( m_pUndoFile->IsCreated() )
    {
        m_Context.UndoFileLastPageNo    = m_pUndoFile->LastPageNo();
        m_Context.LastUndoEntrySequence = m_pUndoFile->GetLastEntrySequence();
    }

    m_pUndoFile->Invalidate();
    destroy (m_pUndoFile, Allocator());
    m_pUndoFile = NULL;

    if ( m_pRedoFile->IsCreated() )
    {
        m_Context.RedoFileLastPageNo          = m_pRedoFile->LastPageNo();
        m_Context.LastCopiedRedoEntrySequence = m_pRedoFile->GetLastEntrySequence();
    }
    m_OldestKnownIOSequence = oldestKnownIOSeq; //PTS 1127704 mb 2004-02-16
}


Generated by  Doxygen 1.6.0   Back to index