From ad645d586aa1f779c2f45b88d85c18ade70385af Mon Sep 17 00:00:00 2001 From: Giacomo Govi Date: Fri, 13 Mar 2015 11:33:23 +0100 Subject: [PATCH] Default format for new condition databases moved to v2 --- CondCore/CondDB/interface/Types.h | 2 +- CondCore/CondDB/src/SessionImpl.cc | 7 +------ CondCore/CondDB/test/MyTestData.h | 22 +++++++++++++++++----- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CondCore/CondDB/interface/Types.h b/CondCore/CondDB/interface/Types.h index d1332e2bd5669..03dcf1a48ace8 100644 --- a/CondCore/CondDB/interface/Types.h +++ b/CondCore/CondDB/interface/Types.h @@ -21,7 +21,7 @@ namespace cond { // to be removed after the transition to new DB typedef enum { UNKNOWN_DB=0, COND_DB, ORA_DB } BackendType; - static constexpr BackendType DEFAULT_DB = ORA_DB; + static constexpr BackendType DEFAULT_DB = COND_DB; // for the validation of migrated data typedef enum { ERROR=0, MIGRATED, VALIDATED } MigrationStatus; static const std::vector validationStatusText = { "Error", diff --git a/CondCore/CondDB/src/SessionImpl.cc b/CondCore/CondDB/src/SessionImpl.cc index 5e16f51dd6941..6393f783c0717 100644 --- a/CondCore/CondDB/src/SessionImpl.cc +++ b/CondCore/CondDB/src/SessionImpl.cc @@ -70,13 +70,8 @@ namespace cond { std::unique_ptr gtSchemaHandle( new OraGTSchema( oraSession ) ); if( !iovSchemaHandle->exists() && !gtSchemaHandle->exists() ){ iovSchemaHandle.reset( new IOVSchema( coralSession->nominalSchema() ) ); - if( iovSchemaHandle->exists() ){ - ret = COND_DB; - } + ret = COND_DB; } else { - // edm::LogWarning("CondDB") << "You are using conditions from the old database via: " - // << connectionString - // << std::endl; ret = ORA_DB; } oraSession.transaction().commit(); diff --git a/CondCore/CondDB/test/MyTestData.h b/CondCore/CondDB/test/MyTestData.h index a08cda80892ce..e7786af681d4d 100644 --- a/CondCore/CondDB/test/MyTestData.h +++ b/CondCore/CondDB/test/MyTestData.h @@ -50,14 +50,24 @@ class MyTestData { } bool operator==( const MyTestData& rhs ) const { - if( a != rhs.a ) return false; - if( b != rhs.b ) return false; + if( a != rhs.a ) { + return false; + } + if( b != rhs.b ) { + return false; + } for( size_t i=0;i<2;i++) for( size_t j=0;j<2;j++){ - if(d[i][j]!=rhs.d[i][j]) return false; - if(f[i][j]!=rhs.f[i][j]) return false; + if(d[i][j]!=rhs.d[i][j]) { + return false; + } + if(f[i][j]!=rhs.f[i][j]) { + return false; + } } - if( s != rhs.s ) return false; + if( s != rhs.s ) { + return false; + } return true; } bool operator!=( const MyTestData& rhs ) const { @@ -84,6 +94,8 @@ void MyTestData::serialize(Archive & ar, const unsigned int) ar & BOOST_SERIALIZATION_NVP(a); ar & BOOST_SERIALIZATION_NVP(b); ar & BOOST_SERIALIZATION_NVP(s); + ar & BOOST_SERIALIZATION_NVP(d); + ar & BOOST_SERIALIZATION_NVP(f); } #endif /* !defined(__GCCXML__) */