[evolution-data-server] CamelDB: Initiate a transaction before writing into db.



commit e8e86635ba145b736760013b755e7ecb19943c87
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Thu May 26 17:01:32 2011 +0530

    CamelDB: Initiate a transaction before writing into db.

 camel/camel-vee-folder.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 91c17b0..c8f172e 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -942,7 +942,11 @@ vee_folder_dispose (GObject *object)
 			folder = CAMEL_FOLDER (vf);
 			parent_store = camel_folder_get_parent_store (folder);
 			record = summary_header_to_db (folder->summary, NULL);
+			
+			camel_db_begin_transaction (parent_store->cdb_w, NULL);
 			camel_db_write_folder_info_record (parent_store->cdb_w, record, NULL);
+			camel_db_end_transaction (parent_store->cdb_w, NULL);
+
 			g_free (record->folder_name);
 			g_free (record);
 		}
@@ -2400,7 +2404,9 @@ camel_vee_folder_sync_headers (CamelFolder *vf,
 	/* Save the counts to DB */
 	record = summary_header_to_db (vf->summary, error);
 	parent_store = camel_folder_get_parent_store (vf);
+	camel_db_begin_transaction (parent_store->cdb_w, NULL);
 	camel_db_write_folder_info_record (parent_store->cdb_w, record, error);
+	camel_db_end_transaction (parent_store->cdb_w, NULL);
 
 	g_free (record->folder_name);
 	g_free (record);



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