Reducing scope of transactions

This commit is contained in:
epoupon
2015-10-08 12:44:28 +02:00
parent 6775431182
commit 0aa0aaab1a
6 changed files with 118 additions and 78 deletions
+8
View File
@@ -77,6 +77,14 @@ Track::create(Wt::Dbo::Session& session, const boost::filesystem::path& p)
return session.add(new Track(p) );
}
std::vector<boost::filesystem::path>
Track::getAllPaths(Wt::Dbo::Session& session)
{
Wt::Dbo::Transaction transaction(session);
Wt::Dbo::collection<std::string> res = session.query<std::string>("SELECT file_path from track");
return std::vector<boost::filesystem::path>(res.begin(), res.end());
}
std::vector< Genre::pointer >
Track::getGenres(void) const
{