00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016 #include "DatabaseUpdater/DbuRunSummary.h"
00017 #include "DatabaseUpdater/DbuSignalHandler.h"
00018
00019 #include "MessageService/MsgService.h"
00020
00021 #include "DatabaseInterface/DbiOutRowStream.h"
00022 #include "DatabaseInterface/DbiResultSet.h"
00023 #include "DatabaseInterface/DbiValidityRec.h"
00024 #include "DatabaseInterface/DbiString.h"
00025
00026 #include "DatabaseUpdater/DbuDaqConfigFilesText.h"
00027 #include "DatabaseUpdater/DbuDaqFileSummary.h"
00028
00029 #include "TMath.h"
00030
00031 #include <iostream>
00032 #include <cassert>
00033
00034 #include "DatabaseUpdater/RunTypeName.h"
00035 #include "OnlineUtil/msgLogLib/msgLog.h"
00036 #include "Util/UtilString.h"
00037
00038 ClassImp(DbuRunSummary)
00039
00040
00041
00042
00043 CVSID("$Id: DbuRunSummary.cxx,v 1.13 2007/02/15 14:15:48 rhatcher Exp $ CVSID_DBIRESULTPTR ");
00044
00045 const std::string DbuRunSummary::kNoComment = "<<No Comment>>";
00046 const std::string DbuRunSummary::kNoRunPrepare = "<<No RunPrepare>>";
00047 const std::string DbuRunSummary::kNoAuxConfig = "<<No AuxConfig>>";
00048 const std::string DbuRunSummary::kUnfilled = "<<Unfilled>>";
00049
00050 UInt_t DbuRunSummary::fgFmtFlag = 0xffff;
00051
00052
00053
00054
00055 #include "DatabaseInterface/DbiResultPtr.tpl"
00056 template class DbiResultPtr<DbuRunSummary>;
00057
00058 #include "DatabaseInterface/DbiWriter.tpl"
00059 template class DbiWriter<DbuRunSummary>;
00060
00061
00062
00063 std::ostream& operator<<(std::ostream& os, const DbuRunSummary& drs)
00064 {
00065
00066 const char* countMatchMsg = "[consistent]";
00067 bool rmatch =
00068 ( drs.fRunEndSnarls == drs.CalcSnarls() ) &&
00069 ( drs.fRunEndNonSnarls == drs.CalcNonSnarls() );
00070 if ( !rmatch ) {
00071 countMatchMsg = "[MISMATCH]";
00072
00073
00074 bool rmatchClose =
00075 ( drs.fRunEndSnarls == drs.CalcSnarls() ) &&
00076 ( drs.fRunEndNonSnarls+1 == drs.CalcNonSnarls() );
00077 if ( rmatchClose) countMatchMsg = "[DAQ off-by-one error]";
00078 }
00079
00080 os << drs.GetName()
00081 << " " << Detector::AsString(drs.fDetector)
00082 << " Run " << drs.fRun
00083 << " LastSubRun " << drs.fLastSubRun
00084 << " RunType " << RunTypeName(drs.fRunType,drs.fDetector,drs.fRun)
00085 << " (0x" << hex << drs.fRunType << dec << ")"
00086 << endl
00087 << " {" << drs.fStartTime << "} {" << drs.fEndTime << "}"
00088 << endl
00089 << " Snarls " << drs.fRunEndSnarls << " (" << drs.CalcSnarls() << ") "
00090 << " NonSnarls " << drs.fRunEndNonSnarls << " (" << drs.CalcNonSnarls() << ") "
00091 << countMatchMsg
00092 << endl
00093 << " TermCode " << drs.fTermCode
00094 << " Errors " << drs.fNErrs
00095 << " TimeFrames " << drs.fTimeFrames
00096 << " Dropped " << drs.fDroppedFrames
00097 << " Consistency 0x" << hex << drs.fConsistency << dec
00098 << endl;
00099
00100 if ( DbuRunSummary::fgFmtFlag & DbuRunSummary::fmt_RunComment ) {
00101 os << " RunComment: \"" << drs.fRunComment << "\"" << endl;
00102 }
00103 if ( DbuRunSummary::fgFmtFlag & DbuRunSummary::fmt_RunPrepare ) {
00104 os << " RunPrepare: \"" << drs.fRunPrepare << "\"" << endl;
00105 }
00106 if ( DbuRunSummary::fgFmtFlag & DbuRunSummary::fmt_AuxConfigText ) {
00107 os << " AuxConfigFiles: \"" << drs.fAuxConfigText << "\"" << endl;
00108 }
00109 if ( DbuRunSummary::fgFmtFlag & DbuRunSummary::fmt_ConfigFilesText ) {
00110 os << " ConfigFilesText:" << endl << *drs.fDbuDaqConfigFilesText;
00111 }
00112 else {
00113 const DbuDaqConfigFilesText* ddcft = drs.fDbuDaqConfigFilesText;
00114 os << " ConfigFilesText:" << endl
00115 << ddcft->GetName() << " SeqNo " << ddcft->fSeqNo
00116 << " MD5 \"" << ddcft->fMD5 << "\" " << endl
00117 << " Text [actual text suppressed]" << endl;
00118 }
00119
00120 if ( DbuRunSummary::fgFmtFlag & DbuRunSummary::fmt_DaqFiles ) {
00121 for (size_t k=0; k < drs.fDbuDaqFiles.size(); ++k) {
00122 const DbuDaqFileSummary* fs = drs.fDbuDaqFiles[k];
00123 if (fs) os << " [" << setw(2) << k << "] " << *fs;
00124 }
00125 }
00126
00127 return os;
00128 }
00129
00130
00131
00132
00133
00134
00135 DbuRunSummary::DbuRunSummary(const DbuRunSummary& from)
00136 : DbiTableRow(from),
00137 fDbuDaqConfigFilesText(0)
00138 {
00139
00140 LEA_CTOR;
00141 *this = from;
00142 }
00143
00144 DbuRunSummary& DbuRunSummary::operator=(const DbuRunSummary& rhs)
00145 {
00146
00147
00148 if (this == &rhs) return *this;
00149
00150 DbiTableRow::operator=(rhs);
00151 this->fDetector = rhs.fDetector;
00152 this->fSimFlag = rhs.fSimFlag;
00153 this->fRun = rhs.fRun;
00154 this->fLastSubRun = rhs.fLastSubRun;
00155 this->fRunType = rhs.fRunType;
00156 this->fStartTime = rhs.fStartTime;
00157 this->fEndTime = rhs.fEndTime;
00158 this->fTermCode = rhs.fTermCode;
00159 this->fRunEndSnarls = rhs.fRunEndSnarls;
00160 this->fRunEndNonSnarls = rhs.fRunEndNonSnarls;
00161 this->fNErrs = rhs.fNErrs;
00162 this->fTimeFrames = rhs.fTimeFrames;
00163 this->fDroppedFrames = rhs.fDroppedFrames;
00164 this->fConsistency = rhs.fConsistency;
00165 this->fRunComment = rhs.fRunComment;
00166 this->fRunPrepare = rhs.fRunPrepare;
00167 this->fAuxConfigText = rhs.fAuxConfigText;
00168
00169 if (this->fDbuDaqConfigFilesText) delete this->fDbuDaqConfigFilesText;
00170 if ( ! rhs.fDbuDaqConfigFilesText ) {
00171 MSG("Dbu",Msg::kError)
00172 << "DbuRunSummary::operator= rhs has no fDbuDaqConfigFilesText"
00173 << endl;
00174 }
00175 this->fDbuDaqConfigFilesText =
00176 new DbuDaqConfigFilesText(*(rhs.fDbuDaqConfigFilesText));
00177
00178
00179 for (size_t j=0; j < this->fDbuDaqFiles.size(); ++j)
00180 { delete this->fDbuDaqFiles[j]; this->fDbuDaqFiles[j] = 0; }
00181
00182
00183 if (rhs.fLastSubRun >= 0) {
00184 size_t mxsize = TMath::Max( rhs.fLastSubRun+1,
00185 (int)rhs.fDbuDaqFiles.size() );
00186 this->fDbuDaqFiles.resize(mxsize);
00187 for (size_t k=0; k < rhs.fDbuDaqFiles.size(); ++k) {
00188 const DbuDaqFileSummary* fs = rhs.fDbuDaqFiles[k];
00189 if (fs) AddDaqFileEntry(*fs);
00190 }
00191 }
00192
00193 return *this;
00194 }
00195
00196
00197
00198 Int_t DbuRunSummary::CalcSnarls() const
00199 {
00200
00201 Int_t snarls = 0;
00202 for (size_t k=0; k < fDbuDaqFiles.size(); ++k) {
00203 const DbuDaqFileSummary* fs = fDbuDaqFiles[k];
00204 if (fs) snarls += fs->fSnarlRecs;
00205 }
00206 return snarls;
00207 }
00208
00209 Int_t DbuRunSummary::CalcNonSnarls() const
00210 {
00211
00212 Int_t nonsnarls = 0;
00213 for (size_t k=0; k < fDbuDaqFiles.size(); ++k) {
00214 const DbuDaqFileSummary* fs = fDbuDaqFiles[k];
00215 if (fs) nonsnarls += ( fs->fMonitorRecs + fs->fLightInjRecs);
00216 }
00217 return nonsnarls;
00218 }
00219
00220
00221
00222 void DbuRunSummary::Fill(DbiResultSet& rs,
00223 const DbiValidityRec* vrec) {
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247 Detector::Detector_t det =
00248 (Detector::Detector_t)
00249 ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00250
00251 SimFlag::SimFlag_t simflag =
00252 (SimFlag::SimFlag_t)
00253 ((vrec) ? vrec->GetVldRange().GetSimMask() : 0);
00254
00255 string detname, runtypename, config_md5;
00256 Int_t config_seqno;
00257
00258
00259 Int_t numDataCol = rs.NumCols() - (rs.HasRowCounter() ? 1 : 0) - 1;
00260 if ( 19 == numDataCol ) {
00261 rs >> detname
00262 >> fRun
00263 >> fLastSubRun
00264 >> fRunType
00265 >> runtypename
00266 >> fStartTime
00267 >> fEndTime
00268 >> fTermCode
00269 >> fRunEndSnarls
00270 >> fRunEndNonSnarls
00271 >> fNErrs
00272 >> fTimeFrames
00273 >> fDroppedFrames
00274 >> fConsistency
00275 >> fRunComment
00276 >> fRunPrepare
00277 >> fAuxConfigText
00278 >> config_md5
00279 >> config_seqno;
00280 }
00281 else if ( 18 == numDataCol ) {
00282 rs >> detname
00283 >> fRun
00284 >> fLastSubRun
00285 >> fRunType
00286 >> runtypename
00287 >> fStartTime
00288 >> fEndTime
00289 >> fTermCode
00290 >> fRunEndSnarls
00291 >> fRunEndNonSnarls
00292 >> fNErrs
00293 >> fTimeFrames
00294 >> fDroppedFrames
00295 >> fConsistency
00296 >> fRunComment
00297 >> fRunPrepare
00298 >> config_md5
00299 >> config_seqno;
00300 }
00301 else {
00302 MAXMSG("Dbu",Msg::kWarning,25)
00303 << "Table " << GetName() << " has " << numDataCol
00304 << ", but we only know how to handle 19 or 18."
00305 << endl;
00306 }
00307
00308 fDetector = Detector::CharToEnum(detname.c_str()[0]);
00309 if (fDetector != det)
00310 MSG("Dbu",Msg::kWarning)
00311 << "Detector column '" << detname << "' (" << (int)fDetector
00312 << ") did not match DetectorMask (" << (int)det << ")" << endl;
00313 fSimFlag = simflag;
00314
00315
00316 VldTimeStamp tsStart(1970, 1, 1, 0, 0, 0);
00317 VldTimeStamp tsEnd(2038, 1,18,19,14, 7);
00318
00319 DbiSqlContext extContextConfig(DbiSqlContext::kStarts,tsStart,tsEnd,
00320 (Detector::Detector_t)127,
00321 (SimFlag::SimFlag_t)127 );
00322
00323
00324
00325 string seqSelectConfig = Form("SEQNO=%d",config_seqno);
00326
00327 DbiResultPtr<DbuDaqConfigFilesText>
00328 rsConfig("DBUDAQCONFIGFILESTEXT",extContextConfig,Dbi::kAnyTask,
00329 seqSelectConfig.c_str());
00330
00331 Int_t nConfig = rsConfig.GetNumRows();
00332 if (nConfig == 1) {
00333 *fDbuDaqConfigFilesText = *rsConfig.GetRow(0);
00334 }
00335 else
00336 MSG("Dbu",Msg::kWarning)
00337 << "Found " << nConfig << " matching DbuDaqConfigFilesText entries"
00338 << endl;
00339
00340 VldTimeStamp tsLower(fStartTime.GetSec()-1,0);
00341 VldTimeStamp tsUpper(fEndTime.GetSec()+1,0);
00342
00343 DbiSqlContext extContextFile(DbiSqlContext::kStarts,
00344 tsLower,tsUpper,
00345 fDetector,simflag);
00346
00347 string seqSelectFile = Form("RUN=%d",fRun);
00348
00349 DbiResultPtr<DbuDaqFileSummary>
00350 rsFiles("DBUDAQFILESUMMARY",extContextFile,Dbi::kAnyTask,
00351 seqSelectFile.c_str());
00352
00353
00354 for (size_t j=0; j < fDbuDaqFiles.size(); ++j)
00355 { delete fDbuDaqFiles[j]; fDbuDaqFiles[j] = 0; }
00356
00357
00358 Int_t nFile = rsFiles.GetNumRows();
00359 Int_t lastSubRunSeen = -1;
00360 for (Int_t k=0; k < nFile; ++k) {
00361 const DbuDaqFileSummary* fs = rsFiles.GetRow(k);
00362 if ( fs->fSubRun > lastSubRunSeen ) lastSubRunSeen = fs->fSubRun;
00363 }
00364 size_t mxsize = TMath::Max( nFile, lastSubRunSeen+1 );
00365
00366 MSG("Dbu",Msg::kDebug)
00367 << " " << Detector::AsString(fDetector) << " Run " << fRun
00368 << " Found " << nFile << " matching DbuDaqFileSummary entries "
00369 << " LastSubRun " << fLastSubRun
00370 << " lastSubRunSeen is " << lastSubRunSeen
00371 << endl;
00372
00373 fDbuDaqFiles.resize(mxsize);
00374 if (mxsize > (size_t)(fLastSubRun+1)) {
00375 MSG("Dbu",Msg::kWarning)
00376 << "LastSubRun was " << fLastSubRun
00377 << " but there are " << nFile << " DbuDaqFileSummary entries "
00378 << " and lastSubRunSeen is " << lastSubRunSeen
00379 << endl;
00380 fLastSubRun = mxsize-1;
00381 }
00382
00383
00384 for (int iFile = 0; iFile < nFile; ++iFile) {
00385 const DbuDaqFileSummary* fs = rsFiles.GetRow(iFile);
00386 if (fs) AddDaqFileEntry(*fs);
00387 }
00388
00389 if ( fLastSubRun != nFile-1 ) {
00390 MAXMSG("Dbu",Msg::kInfo,20)
00391 << " ! fLastSubRun is " << fLastSubRun
00392 << " but there are " << nFile
00393 << " DbuDaqFileSummary entries" << endl;
00394 }
00395
00396 }
00397
00398
00399 void DbuRunSummary::AddDaqFileEntry(const DbuDaqFileSummary& fs)
00400 {
00401
00402
00403 Short_t subrun = fs.fSubRun;
00404 if (subrun < 0) {
00405 MSG("Dbu",Msg::kWarning)
00406 << "DbuDaqFileSummary had SubRun=" << subrun << "?!"
00407 << endl;
00408 return;
00409 }
00410 if ( fDbuDaqFiles[subrun] ) {
00411 MSG("Dbu",Msg::kWarning)
00412 << "DbuDaqFileSummary had previous entry for SubRun="
00413 << subrun << "?!"
00414 << endl;
00415 return;
00416 }
00417 if ( fDbuDaqFiles.size() < (size_t)subrun+1 ) {
00418 MSG("Dbu",Msg::kWarning)
00419 << "DbuDaqFileSummary allocated " << fDbuDaqFiles.size()
00420 << ", saw " << subrun << "?!"
00421 << endl;
00422 fDbuDaqFiles.resize(subrun+1);
00423 }
00424 fDbuDaqFiles[subrun] = new DbuDaqFileSummary(fs);\
00425 }
00426
00427
00428
00429 void DbuRunSummary::Store(DbiOutRowStream& ors,
00430 const DbiValidityRec* ) const {
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454 ors << Detector::AsString(fDetector)
00455 << fRun
00456 << fLastSubRun
00457 << fRunType
00458 << RunTypeName(fRunType,fDetector,fRun)
00459 << fStartTime
00460 << fEndTime
00461 << fTermCode
00462 << fRunEndSnarls
00463 << fRunEndNonSnarls
00464 << fNErrs
00465 << fTimeFrames
00466 << fDroppedFrames
00467 << fConsistency
00468 << fRunComment;
00469
00470 }
00471
00472
00473
00474 Int_t DbuRunSummary::CalcUniqueSeqNo(Detector::Detector_t det, Int_t run)
00475 {
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500 return 99 + 100*(run + 1000000*det);
00501 }
00502
00503
00504
00505 Bool_t DbuRunSummary::IsSameRun(Detector::Detector_t det, Int_t run)
00506 {
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524 return (fDetector == det) && (fRun == run);
00525 }
00526
00527
00528
00529 const char* DbuRunSummary::GetTableDescr()
00530 {
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550 const char* const_tabledescr = "(\
00551 SEQNO int, \
00552 ROW_COUNTER int, \
00553 DETECTOR tinytext, \
00554 RUN int, \
00555 LAST_SUBRUN smallint, \
00556 RUNTYPE smallint, \
00557 RUNTYPE_NAME varchar(24),\
00558 STARTTIME datetime, \
00559 ENDTIME datetime, \
00560 TERMCODE int, \
00561 RUNEND_SNARLS int, \
00562 RUNEND_NONSNARLS int, \
00563 NERRS int, \
00564 NTIMEFRAMES int, \
00565 NDROPPEDFRAMES int, \
00566 CONSISTENCY_BITS int, \
00567 RUN_COMMENT text, \
00568 RUNPREPARE_STRING text, \
00569 AUX_CONFIG_TEXT text, \
00570 CONFIGFILES_MD5 text, \
00571 CONFIGFILES_SEQNO int, \
00572 primary key (SEQNO,ROW_COUNTER), \
00573 index (RUN) )";
00574
00575 return const_tabledescr;
00576 }
00577
00578
00579
00580 Bool_t DbuRunSummary::Commit(DbiStatement* stmt,
00581 std::string cft_md5, int cft_seqno)
00582 {
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604 if (!stmt) return false;
00605
00606
00607 DbuSignalHandler::Instance().Delay();
00608
00609 Int_t seqno = GetSeqNo();
00610 string tbl = "DBURUNSUMMARY";
00611 string tblv = "DBURUNSUMMARYVLD";
00612
00613
00614
00615 DbiString sqlrm, sqlrmv;
00616
00617 sqlrm << "delete from " << tbl << " where SEQNO=" << seqno << ";\0";
00618 Int_t nrm = stmt->ExecuteUpdate(sqlrm.c_str());
00619 stmt->PrintExceptions();
00620
00621 sqlrmv << "delete from " << tblv << " where SEQNO=" << seqno << ";\0";
00622 Int_t nrmv = stmt->ExecuteUpdate(sqlrmv.c_str());
00623 stmt->PrintExceptions();
00624
00625
00626
00627 string printableRunComment;
00628 UtilString::MakePrintable(fRunComment.c_str(),printableRunComment);
00629 string printableRunPrepare;
00630 UtilString::MakePrintable(fRunPrepare.c_str(),printableRunPrepare);
00631 string printableAuxConfigText;
00632 UtilString::MakePrintable(fAuxConfigText.c_str(),printableAuxConfigText);
00633
00634 DbiString sqlcol, sqlval;
00635 sqlcol << " SEQNO ";
00636 sqlval << seqno;
00637 sqlcol << ", DETECTOR ";
00638 sqlval << ",'" << Detector::AsString(fDetector) << "'";
00639 sqlcol << ", RUN ";
00640 sqlval << "," << fRun;
00641 sqlcol << ", LAST_SUBRUN ";
00642 sqlval << "," << fLastSubRun;
00643 sqlcol << ", RUNTYPE ";
00644 sqlval << "," << fRunType;
00645 sqlcol << ", RUNTYPE_NAME ";
00646 sqlval << ",'" << RunTypeName(fRunType,fDetector,fRun) << "'";
00647 sqlcol << ", STARTTIME ";
00648 sqlval << ",'" << fStartTime.AsString("s") << "'";
00649 sqlcol << ", ENDTIME ";
00650 sqlval << ",'" << fEndTime.AsString("s") << "'";
00651 sqlcol << ", TERMCODE ";
00652 sqlval << "," << fTermCode;
00653 sqlcol << ", RUNEND_SNARLS ";
00654 sqlval << "," << fRunEndSnarls;
00655 sqlcol << ", RUNEND_NONSNARLS ";
00656 sqlval << "," << fRunEndNonSnarls;
00657 sqlcol << ", NERRS ";
00658 sqlval << "," << fNErrs;
00659 sqlcol << ", NTIMEFRAMES ";
00660 sqlval << "," << fTimeFrames;
00661 sqlcol << ", NDROPPEDFRAMES ";
00662 sqlval << "," << fDroppedFrames;
00663 sqlcol << ", CONSISTENCY_BITS ";
00664 sqlval << "," << fConsistency;
00665 sqlcol << ", RUN_COMMENT ";
00666 sqlval << ",'" << printableRunComment << "'";
00667 sqlcol << ", RUNPREPARE_STRING ";
00668 sqlval << ",'" << printableRunPrepare << "'";
00669 sqlcol << ", AUX_CONFIG_TEXT ";
00670 sqlval << ",'" << printableAuxConfigText << "'";
00671 sqlcol << ", CONFIGFILES_MD5 ";
00672 sqlval << ",'" << cft_md5 << "'";
00673 sqlcol << ", CONFIGFILES_SEQNO ";
00674 sqlval << "," << cft_seqno;
00675
00676 DbiString sqlinsert;
00677 sqlinsert << "insert into " << tbl
00678 << " ( " << sqlcol.c_str() << " ) "
00679 << " values ( " << sqlval.c_str() << " ) ;\0";
00680
00681 MSG("Dbu",Msg::kDebug) << sqlinsert.c_str() << endl;
00682
00683 VldTimeStamp now;
00684
00685 const Int_t task = 0;
00686
00687 DbiString sqlcolv, sqlvalv;
00688 sqlcolv << " SEQNO";
00689 sqlvalv << seqno;
00690 sqlcolv << ", TIMESTART ";
00691 sqlvalv << ",'" << fStartTime.AsString("s") << "'";
00692 sqlcolv << ", TIMEEND ";
00693 sqlvalv << ",'" << fEndTime.AsString("s") << "'";
00694 sqlcolv << ", DETECTORMASK ";
00695 sqlvalv << "," << fDetector;
00696 sqlcolv << ", SIMMASK ";
00697 sqlvalv << "," << fSimFlag;
00698 sqlcolv << ", TASK ";
00699 sqlvalv << "," << task;
00700 sqlcolv << ", AGGREGATENO ";
00701 sqlvalv << "," << GetAggregateNo();
00702 sqlcolv << ", CREATIONDATE ";
00703 sqlvalv << ",'" << now.AsString("s") << "'" ;
00704 sqlcolv << ", INSERTDATE ";
00705 sqlvalv << ",'" << now.AsString("s") << "'";
00706
00707 DbiString sqlinsertv;
00708 sqlinsertv << "insert into " << tblv
00709 << " ( " << sqlcolv.c_str() << " ) "
00710 << " VALUES ( " << sqlvalv.c_str() << " ) ;\0";
00711
00712 MSG("Dbu",Msg::kDebug)
00713 << "insert into " << tblv
00714 << " ( " << sqlcolv.c_str() << " ) "
00715 << " VALUES ( " << sqlvalv.c_str() << " ) ;"
00716 << endl;
00717
00718 Int_t ninsert = stmt->ExecuteUpdate(sqlinsert.c_str());
00719 stmt->PrintExceptions();
00720
00721 Int_t ninsertv = stmt->ExecuteUpdate(sqlinsertv.c_str());
00722 stmt->PrintExceptions();
00723
00724 MSG("Dbu",Msg::kVerbose)
00725 << sqlinsert.c_str() << endl;
00726 MSG("Dbu",Msg::kVerbose)
00727 << sqlinsertv.c_str() << endl;
00728
00729 char tmpbuf[1024];
00730 sprintf(tmpbuf,"Commit DbuRunSummary %c%8.8d",
00731 Detector::AsString(fDetector)[0],fRun);
00732
00733 MSG("Dbu",Msg::kDebug)
00734 << tmpbuf
00735
00736 << " rm/in "
00737 << nrm << "," << nrmv << "/"
00738 << ninsert << "," << ninsertv
00739 << endl;
00740
00741 logDebug(1,"%s rm=%d,%d in=%d,%d @ %s",
00742 tmpbuf,nrm,nrmv,ninsert,ninsertv,now.AsString("s"));
00743
00744 bool success = (ninsert==1) && (ninsertv==1);
00745
00746
00747 DbuSignalHandler::Instance().HandleDelayedSignal();
00748
00749
00750 return success;
00751 }
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783