]> git.jsancho.org Git - mojodb.git/blobdiff - MySQL.py
Savepoints to protect integrity of documents
[mojodb.git] / MySQL.py
index ba00c333349485a6fd7d2549826d1e7cc5654734..03969f78c5add49964e417498a6d56bc11dcb637 100644 (file)
--- a/MySQL.py
+++ b/MySQL.py
@@ -171,3 +171,15 @@ class Connection(connection.Connection):
 
     def rollback(self):
         self._db_con.rollback()
+
+    def savepoint(self, name):
+        self.execute("SAVEPOINT %s" % name)
+        return True
+
+    def commit_savepoint(self, name):
+        self.execute("RELEASE SAVEPOINT %s" % name)
+        return True
+
+    def rollback_savepoint(self, name):
+        self.execute("ROLLBACK TO %s" % name)
+        return True