[rygel] core: add begin, commit and rollback methods



commit 913d126748783af1fe20ea28d61eb6e5b4c84d3e
Author: Jens Georg <mail jensge org>
Date:   Wed Sep 30 12:34:22 2009 +0200

    core: add begin, commit and rollback methods

 src/rygel/rygel-database.vala |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-database.vala b/src/rygel/rygel-database.vala
index 4ba9b0f..706b97f 100644
--- a/src/rygel/rygel-database.vala
+++ b/src/rygel/rygel-database.vala
@@ -142,4 +142,22 @@ internal class Rygel.Database : Object {
         v.set_pointer (null);
         return v;
     }
+
+    public void begin () throws DatabaseError {
+        if (this.db.exec ("BEGIN") != Sqlite.OK) {
+            throw new DatabaseError.SQLITE_ERROR (db.errmsg ());
+        }
+    }
+
+    public void commit () throws DatabaseError {
+        if (this.db.exec ("COMMIT") != Sqlite.OK) {
+            throw new DatabaseError.SQLITE_ERROR (db.errmsg ());
+        }
+    }
+
+    public void rollback () throws DatabaseError {
+        if (this.db.exec ("ROLLBACK") != Sqlite.OK) {
+            throw new DatabaseError.SQLITE_ERROR (db.errmsg ());
+        }
+    }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]