diff --git a/config-vdms.json b/config-vdms.json index 23ea1b68..c3df33e6 100644 --- a/config-vdms.json +++ b/config-vdms.json @@ -6,10 +6,6 @@ "port": 55555, // Default is 55555 "max_simultaneous_clients": 20, // Default is 500 - // Tune the number of maximum attempts when acquiring the - // reader writer lock for metadata changes. - "max_lock_attempts": 10, - // Database paths "pmgd_path": "db/graph", // This will be an IP address in the future "png_path": "db/images/pngs/", diff --git a/src/PMGDQueryHandler.cc b/src/PMGDQueryHandler.cc index 07819611..240df2b9 100644 --- a/src/PMGDQueryHandler.cc +++ b/src/PMGDQueryHandler.cc @@ -34,7 +34,6 @@ #include "PMGDQueryHandler.h" #include "util.h" // PMGD util #include "PMGDIterators.h" -#include "RWLock.h" // TODO In the complete version of VDMS, this file will live // within PMGD which would replace the PMGD namespace. Some of @@ -43,30 +42,21 @@ using namespace PMGD; using namespace VDMS; PMGD::Graph *PMGDQueryHandler::_db; -RWLock *PMGDQueryHandler::_dblock; void PMGDQueryHandler::init() { std::string dbname = VDMSConfig::instance() ->get_string_value("pmgd_path", "db/graph"); - unsigned attempts = VDMSConfig::instance() - ->get_int_value("max_lock_attempts", - RWLock::MAX_ATTEMPTS); // Create a db _db = new PMGD::Graph(dbname.c_str(), PMGD::Graph::Create); - - // Create the query handler here assuming database is valid now. - _dblock = new RWLock(attempts); } void PMGDQueryHandler::destroy() { if (_db) { delete _db; - delete _dblock; _db = NULL; - _dblock = NULL; } } @@ -80,20 +70,6 @@ std::vector // Assuming one query handler handles one TX at a time. _readonly = readonly; - try { - if (_readonly) - _dblock->read_lock(); - else - _dblock->write_lock(); - } - catch (Exception e) { - PMGDCmdResponses &resp_v = responses[0]; - PMGDCmdResponse *response = new PMGDCmdResponse(); - set_response(response, PMGDCmdResponse::Exception, - e.name + std::string(": ") + e.msg); - resp_v.push_back(response); - return responses; - } for (const auto cmd : cmds) { PMGDCmdResponse *response = new PMGDCmdResponse(); @@ -117,10 +93,6 @@ std::vector _tx = NULL; } - if (_readonly) - _dblock->read_unlock(); - else - _dblock->write_unlock(); return responses; } diff --git a/src/PMGDQueryHandler.h b/src/PMGDQueryHandler.h index 671a4f14..3a17f6e8 100644 --- a/src/PMGDQueryHandler.h +++ b/src/PMGDQueryHandler.h @@ -58,8 +58,6 @@ namespace VDMS { typedef std::vector PMGDCmds; typedef std::vector PMGDCmdResponses; - class RWLock; - class PMGDQueryHandler { template @@ -73,9 +71,6 @@ namespace VDMS { // Until we have a separate PMGD server this db lives here static PMGD::Graph *_db; - // Need this lock till we have concurrency support in PMGD - static RWLock *_dblock; - PMGD::Transaction *_tx; bool _readonly; // Variable changes per TX based on process_queries parameter.