[Pkg-owncloud-commits] [owncloud-client] 90/211: ownsql: Implement the transaction functions.
    Sandro Knauß 
    hefee-guest at moszumanska.debian.org
       
    Sat Oct 25 09:10:29 UTC 2014
    
    
  
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 89c51e7649ff84dfc14a006465c18a5e68660a1c
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Oct 15 19:47:25 2014 +0200
    ownsql: Implement the transaction functions.
---
 src/mirall/ownsql.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/mirall/ownsql.cpp b/src/mirall/ownsql.cpp
index d9a795b..df58294 100644
--- a/src/mirall/ownsql.cpp
+++ b/src/mirall/ownsql.cpp
@@ -68,12 +68,20 @@ void SqlDatabase::close()
 
 bool SqlDatabase::transaction()
 {
-    return true;
+    if( ! _db ) {
+        return false;
+    }
+    SQLITE_DO(sqlite3_exec(_db, "BEGIN", 0, 0, 0));
+    return _errId == SQLITE_OK;
 }
 
 bool SqlDatabase::commit()
 {
-    return true;
+    if( ! _db ) {
+        return false;
+    }
+    SQLITE_DO(sqlite3_exec(_db, "COMMIT", 0, 0, 0));
+    return _errId == SQLITE_OK;
 }
 
 sqlite3* SqlDatabase::sqliteDb()
-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
    
    
More information about the Pkg-owncloud-commits
mailing list