summaryrefslogtreecommitdiff
path: root/project2/sql/rdbmsDataSource.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-04-28 21:02:14 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-04-28 21:02:14 +0100
commit8af06d99317d2fdc499eef86d9d5e9c157a052c2 (patch)
treeabae878df2134e562b76ce8ab40860140e70e9f4 /project2/sql/rdbmsDataSource.cpp
parentPass include dirs to slice tools (diff)
downloadproject2-8af06d99317d2fdc499eef86d9d5e9c157a052c2.tar.bz2
project2-8af06d99317d2fdc499eef86d9d5e9c157a052c2.tar.xz
project2-8af06d99317d2fdc499eef86d9d5e9c157a052c2.zip
Move the mocked PQ db into the PQ module and start the basis of the SQL mod unit tests
Diffstat (limited to 'project2/sql/rdbmsDataSource.cpp')
-rw-r--r--project2/sql/rdbmsDataSource.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/project2/sql/rdbmsDataSource.cpp b/project2/sql/rdbmsDataSource.cpp
index b25e8dc..5f0d43a 100644
--- a/project2/sql/rdbmsDataSource.cpp
+++ b/project2/sql/rdbmsDataSource.cpp
@@ -116,14 +116,20 @@ RdbmsDataSource::getReadonly() const
}
void
+RdbmsDataSource::close()
+{
+ LOCK(ilock);
+ LOCK(glock);
+ RdbmsDataSource::dbhosts.clear();
+}
+
+void
RdbmsDataSource::commit()
{
LOCK(ilock);
LOCK(glock);
auto masters = dbhosts.equal_range(masterDsn);
for (auto m = masters.first; m != masters.second; m++) {
- if (m->second->threadId) {
- }
if (m->second->txOpen && m->second->threadId && *m->second->threadId == std::this_thread::get_id()) {
m->second->connection->commitTx();
m->second->txOpen = false;