--- chewbacca/PamOffLineSW/PacketUser.cpp 2010/01/08 13:36:14 1.13 +++ chewbacca/PamOffLineSW/PacketUser.cpp 2010/02/02 15:26:09 1.16 @@ -1,5 +1,5 @@ //============================================================================ -// $Id: PacketUser.cpp,v 1.12 2009/12/30 14:49:51 mocchiut Exp $ +// $Id: PacketUser.cpp,v 1.15 2010/01/15 14:31:17 mocchiut Exp $ // Description : //============================================================================ #include "PacketUser.h" @@ -31,7 +31,7 @@ //marco_new_31: extern char* db_user; extern char* db_pwd; -extern char* connection; +extern char* pelosconnection; //per tenere conto reset obt extern unsigned long int max_pkt_obt; @@ -647,39 +647,39 @@ } CleanDisk(); - if (!single_connection) { - CloseDBConnection(); - } - return; + // if (!single_connection) { + // CloseDBConnection(); + // } + // return; // commented here... }; } if ( real_time_init || real_time_last) { - //saves info in DB in table Table_ROOT - if (boot_number == 0) - boot_number = boot_number_prevvalue; - - if (saveROOT_DB( - Table_ROOT_Good, - outDir, // here outDir is good, no expand EMI - filename, pkt_number_init, pkt_number_last, obt_init, obt_last, obt_time_sync, last_time_sync_info, - real_time_init, real_time_last, boot_number, timeOffset, bad_pkt, bad_pkt_EventReader, bad_pkt_CalibReader, - numPKTSaved, fni, time_is_estimated) == true) { - oss.str() = ""; - oss << "Saved information regarding file: " << filename << " in table " << Table_ROOT_Good << " id= " << my_id; - msg = oss.str(); - mainLogUtil->logInfo(msg); + //saves info in DB in table Table_ROOT + if (boot_number == 0) + boot_number = boot_number_prevvalue; - if (tryMerge) { - merge_ROOTfiles(); - } - } else { + if (saveROOT_DB( + Table_ROOT_Good, + outDir, // here outDir is good, no expand EMI + filename, pkt_number_init, pkt_number_last, obt_init, obt_last, obt_time_sync, last_time_sync_info, + real_time_init, real_time_last, boot_number, timeOffset, bad_pkt, bad_pkt_EventReader, bad_pkt_CalibReader, + numPKTSaved, fni, time_is_estimated) == true) { + oss.str() = ""; + oss << "Saved information regarding file: " << filename << " in table " << Table_ROOT_Good << " id= " << my_id; + msg = oss.str(); + mainLogUtil->logInfo(msg); + + if (tryMerge) { + merge_ROOTfiles(); + } + } else { oss.str() = ""; oss << "Problem storing information in DB regarding file: " << filename; msg = oss.str(); mainLogUtil->logError(msg); - } + } }; // if dbinfo is not empty than @@ -1461,7 +1461,7 @@ if (do_cont_check) { //controllo che non sia gia' aperta if (!sqlServer) { - sqlServer = TSQLServer::Connect(connection, db_user, db_pwd); + sqlServer = TSQLServer::Connect(pelosconnection, db_user, db_pwd); if ((!sqlServer) || (!(sqlServer->IsConnected()))) { cout << "Can not connect with MYSQL sever" << endl; }