summaryrefslogtreecommitdiff
path: root/p2pvr/lib/dbClient.cpp
blob: a9b74e5448bc99166140f1d16b0342daa15e1fec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <pch.hpp>
#include "dbClient.h"

void
DatabaseClient::onAllDatasources(const DataSourceCall & call) const
{
	BOOST_FOREACH(const CommonObjects::DataSources::value_type & ds, CommonObjects::datasources) {
		call(ds.second);
	}
}

DatabaseClient::TxHelper::TxHelper(const DatabaseClient * dbc) :
	so(NULL,
		boost::bind(&DatabaseClient::onAllDatasources, dbc, DataSourceCall(boost::bind(&DataSource::commit, _1))),
		boost::bind(&DatabaseClient::onAllDatasources, dbc, DataSourceCall(boost::bind(&DataSource::rollback, _1))))
{
}

DatabaseClient::NoRowsFoundException::NoRowsFoundException() :
	std::runtime_error("No rows found")
{
}