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

void SAPDBErr_MessageList::AppendNewMessage ( SAPDBErr_MessageList const &  MessageList  ) 

--------------------------------------------------------------------------- Function: AppendNewMessage Description: This methode appends a new message list to the current message list.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

You should always append an newer message to an older one to get a correct message ordering.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 286 of file SAPDBErr_MessageList.cpp.

References CopyMessageList(), GetObjectRef(), RTEMem_RteAllocator::Instance(), m_NumOfMessages, m_pMessageData, m_pNextMessage, SplitObjectList(), and SubtractObjectRef().

Referenced by DBProc_Handler::CalculateFunctionResult(), DBMCli_Result::Check(), cn85_DBExecute(), DBMSrvKnl_Session::Connect(), DBMSrvHSS_Nodes::Create(), DBMSrvHSS_Nodes::Execute(), DBMCli_Session::Execute(), DBProc_Handler::ExecuteSqlStatement(), DBMSrvKnl_Session::FallbackConnect(), DBMSrvHSS_Nodes::GetNode(), DBMSrvHSS_Nodes::HSSError(), DBMSrvKnl_Session::NormalConnect(), operator+(), DBMSrvMsg_Error::operator+(), Catalog_TableObject::outcopy(), Kernel_Administration::PrepareStandby(), DBMSrvKnl_Session::ReadErrorText(), DBMSrvKnl_Session::Receive(), DBMSrvKnl_Session::Request(), DBMSrvCmdDb_DbReg::ReRegisterDatabase(), DBMSrvCmdDb_DbReg::run(), DBMSrvCmdDb_DbUnreg::run(), SAPDB_HandleMoveErrorMessageList(), SAPDB_PascalFill(), SAPDB_PascalMove(), SAPDB_PascalOverlappingMove(), SAPDB_PascalUnicodeFill(), SAPDB_RangeFill(), SAPDB_RangeMove(), SAPDB_RangeOverlappingMove(), SAPDB_RangeUnicodeFill(), RTE_GlobalMultiThread::SetLastErrorMessage(), RTE_Global::SetLastErrorMessage(), RTETask_Context::SetLastErrorMessage(), Catalog_SessionCache::StorePlan(), and Catalog_SessionCache::StorePlanObject().

{
  SAPDBErr_MessageList*      pCurrMsg = this;

  // --- don't append empty message lists!
  if ( MessageList.m_pMessageData != NULL )
  {
    // --- is the current message list empty
    if ( pCurrMsg->m_pMessageData == NULL )
    {
      // --- copy the 
      pCurrMsg->CopyMessageList(MessageList);
    }
    else
    {
      SAPDBErr_MessageList*   pAppendMsg;

      // --- create a new 'MessageList' object which will be appended
      pAppendMsg = new (RTEMem_RteAllocator::Instance()) SAPDBErr_MessageList;

      if ( pAppendMsg != NULL )
      {
        // --- copy the 'MessageList' to the new append object
        pAppendMsg->CopyMessageList(MessageList);

        // --- step to the 'MessageList' end
        for (;pCurrMsg->m_pNextMessage != NULL;)
        {
          // --- check if a list splitting is necessary because 
          //     of a multiple object reference. This means two or more
          //     objects are sharing the same data. A append of a new message
          //     must not affect the contents of other message lists!!
          if ( pCurrMsg->m_pNextMessage->GetObjectRef() > 1 )
          {
            pCurrMsg->m_pNextMessage->SubtractObjectRef();
            pCurrMsg->m_pNextMessage = pCurrMsg->m_pNextMessage->SplitObjectList();
          }

          // --- is there another object?
          if ( pCurrMsg->m_pNextMessage != NULL )
          {
            // --- add the number of message we intend to append
            pCurrMsg->m_NumOfMessages += pAppendMsg->m_NumOfMessages;

            pCurrMsg = pCurrMsg->m_pNextMessage;
          }
        }

        // --- add the number of message we intend to append
        pCurrMsg->m_NumOfMessages += pAppendMsg->m_NumOfMessages;

        // ---  append the previously created append object
        pCurrMsg->m_pNextMessage = pAppendMsg;
      }
    }
  }
}


Generated by  Doxygen 1.6.0   Back to index