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



commit 236c96932aba9966dbbbdf961e2ed73c474df452
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 4bd1abd..8fef906 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -944,7 +944,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);
 		}
@@ -2393,7 +2397,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]