dm-metamapper 0.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -313,5 +313,24 @@ sanitize(const string& s)
|
|
313
313
|
return q.str();
|
314
314
|
}
|
315
315
|
|
316
|
+
void
|
317
|
+
DBFace::startTransaction()
|
318
|
+
{
|
319
|
+
Query q = _connection.query();
|
320
|
+
|
321
|
+
q << "START TRANSACTION";
|
322
|
+
boost::mutex::scoped_lock lock(_mutex);
|
323
|
+
executeQuery(q);
|
324
|
+
}
|
325
|
+
|
326
|
+
void
|
327
|
+
DBFace::commitTransaction()
|
328
|
+
{
|
329
|
+
Query q = _connection.query();
|
330
|
+
|
331
|
+
q << "COMMIT";
|
332
|
+
boost::mutex::scoped_lock lock(_mutex);
|
333
|
+
executeQuery(q);
|
334
|
+
}
|
316
335
|
|
317
336
|
} //namespace DMMM
|
@@ -47,13 +47,17 @@ public:
|
|
47
47
|
const std::string& where);
|
48
48
|
|
49
49
|
std::string now();
|
50
|
-
|
50
|
+
|
51
|
+
void startTransaction();
|
52
|
+
void commitTransaction();
|
53
|
+
|
51
54
|
private:
|
52
55
|
void log(const std::string& message);
|
53
56
|
void logError(const std::string& message);
|
54
57
|
bool getLastInsertId(mysqlpp::Query& rQuery, size_t& rId);
|
55
58
|
bool executeQuery(mysqlpp::Query& rQuery);
|
56
59
|
|
60
|
+
|
57
61
|
private:
|
58
62
|
mysqlpp::Connection _connection;
|
59
63
|
mutable boost::mutex _mutex;
|
metadata
CHANGED