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.
@@ -1,6 +1,6 @@
1
1
  module DataMapper
2
2
  module MetaMapper
3
- VERSION = "0.3" unless defined?(::DataMapper::MetaMapper::VERSION)
3
+ VERSION = "0.3.1" unless defined?(::DataMapper::MetaMapper::VERSION)
4
4
  end
5
5
 
6
6
  end
@@ -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
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-metamapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- version: "0.3"
9
+ - 1
10
+ version: 0.3.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Jonah Honeyman