AUDIT: r21831 - gnucash/trunk/src/backend/dbi - [Bug 666329] Empty database after a little while

John Ralls jralls at code.gnucash.org
Mon Jan 9 18:10:06 EST 2012


Author: jralls
Date: 2012-01-09 18:10:06 -0500 (Mon, 09 Jan 2012)
New Revision: 21831
Trac: http://svn.gnucash.org/trac/changeset/21831

Modified:
   gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c
Log:
[Bug 666329] Empty database after a little while

Use gnc_dbi_safe_sync_all (which doesn't lose data if the save partion
errors out) for all be->sync.

This is a bit of a half-way solution; we really shouldn't ever have to do
this except when creating a new database, but fixing that will take major
surgery.

BP

Modified: gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c
===================================================================
--- gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c	2012-01-09 23:09:57 UTC (rev 21830)
+++ gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c	2012-01-09 23:10:06 UTC (rev 21831)
@@ -1516,6 +1516,9 @@
  * Really a bit of an understatement. More like "delete everything in
  * storage and replace with what's in memory".
  *
+ * THIS ROUTINE IS EXTREMELY DANGEROUS AND CAN LEAD TO SEVERE DATA
+ * LOSS It should be used *only* by gnc_dbi_safe_sync_all!
+ *
  * @param qbe: QofBackend for the session.
  * @param book: QofBook to be saved in the database.
  */
@@ -1679,7 +1682,9 @@
     be->events_pending = NULL;
     be->process_events = NULL;
 
-    be->sync = gnc_dbi_sync_all;
+/* The SQL/DBI backend doesn't need to be synced until it is
+ * configured for multiuser access. */
+    be->sync = gnc_dbi_safe_sync_all;
     be->safe_sync = gnc_dbi_safe_sync_all;
     be->load_config = NULL;
     be->get_config = NULL;



More information about the gnucash-changes mailing list