X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..2574a28cbf000603bc31f61593dbf061ff56c1d5:/projects/stargazer/plugins/store/firebird/firebird_store_corporations.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_corporations.cpp b/projects/stargazer/plugins/store/firebird/firebird_store_corporations.cpp index 3b9ad785..4e9cac4d 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_corporations.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_corporations.cpp @@ -35,19 +35,18 @@ //----------------------------------------------------------------------------- int FIREBIRD_STORE::GetCorpsList(std::vector * corpsList) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); -std::string name; - try { tr->Start(); st->Execute("select name from tb_corporations"); while (st->Fetch()) { + std::string name; st->Get(1, name); corpsList->push_back(name); } @@ -67,7 +66,7 @@ return 0; //----------------------------------------------------------------------------- int FIREBIRD_STORE::SaveCorp(const STG::CorpConf & cc) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); @@ -95,7 +94,7 @@ return 0; //----------------------------------------------------------------------------- int FIREBIRD_STORE::RestoreCorp(STG::CorpConf * cc, const std::string & name) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); @@ -133,7 +132,7 @@ return 0; //----------------------------------------------------------------------------- int FIREBIRD_STORE::AddCorp(const std::string & name) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); @@ -160,7 +159,7 @@ return 0; //----------------------------------------------------------------------------- int FIREBIRD_STORE::DelCorp(const std::string & name) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr);