From: <ro...@ci...> - 2006-07-19 04:23:05
|
Hi Mark, While testing the Trade Cleanup transaction, I found what could be other two mistakes in EGen 3.14. ***Problem 1*** The Data Maintenance class, DM, which is responsible for calling both Data Maintenance and Trade Cleanup transactions, seems to be initializing one of its members in the wrong way. The member in question is the DriverGlobalSettings class, which expects to receive the number of days of initial trades, that was populated during load time, but in fact it is receiving hours of initial trades. This mistake leads to a wrong calculation of start_trade_id by the DM. The start_trade_id is one of the input parameters of the Trade Cleanup transaction. Please, see the code below extracted from DM.cpp, which represents one of the constructors of CDM: CDM::CDM( CDMSUTInterface *pSUT, CBaseLogger *pLogger, CInputFiles &inputFiles, TIdent iConfiguredCustomerCount, TIdent iActiveCustomerCount, INT32 iDaysOfInitialTrades, INT32 iScaleFactor, UINT32 UniqueId ) (...) , m_DriverGlobalSettings ( iConfiguredCustomerCount, iActiveCustomerCount, iScaleFactor, iDaysOfInitialTrades * HoursPerWorkDay ) (...) I would expect to find iDaysOfInitialTrades instead of (iDaysOfInitialTrades * HoursPerWorkDay), like in the Customer Emulator class: CCE::CCE( CCESUTInterface *pSUT, CBaseLogger *pLogger, CInputFiles &inputFiles, TIdent iConfiguredCustomerCount, TIdent iActiveCustomerCount, INT32 iScaleFactor, INT32 iDaysOfInitialTrades, UINT32 UniqueId, PDriverCETxnSettings pDriverCETxnSettings ) (...) , m_DriverGlobalSettings( iConfiguredCustomerCount, iActiveCustomerCount, iScaleFactor, iDaysOfInitialTrades ) (...) ***Problem 2*** In DM.cpp again, in CDM::DoCleanupTxn, you'll see: (...) // Copy the status type id's from the flat file strncpy(m_CleanupTxnInput.st_pending_id, (m_pStatusType->GetRecord(ePending))->ST_ID, sizeof(m_CleanupTxnInput.st_pending_id)); strncpy(m_CleanupTxnInput.st_pending_id, (m_pStatusType->GetRecord(eSubmitted))->ST_ID, sizeof(m_CleanupTxnInput.st_submitted_id)); strncpy(m_CleanupTxnInput.st_pending_id, (m_pStatusType->GetRecord(eCanceled))->ST_ID, sizeof(m_CleanupTxnInput.st_canceled_id)); (...) This sounds like the recurrent copy/paste mistake =D, m_CleanupTxnInput.st_pending_id is being updated three times. The 1st strncpy is OK, the 2nd should be m_CleanupTxnInput.st_submitted_id and the 3rd should be m_CleanupTxnInput.st_canceled_id. These three variables are input parameters for Trade Cleanup as well. I have changed DM.cpp to correct these problems. I have checked in this file together with the files related to the Trade Cleanup transaction for your review. In the last e-mail you asked me to create a file to document the differences. If you remember, when I was working in the loader I created a doc called ChangeLog_PGSQL.odt to document the changes caused by the addition of the PostgreSQL loader. Do you think it's a good idea to update this doc or should I create another one ? best, -Rilson |