[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

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21831 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls
2012-01-09 23:10:06 +00:00
parent 614052092e
commit 2317920635

View File

@@ -1516,6 +1516,9 @@ conn_table_operation( GncSqlConnection *sql_conn, GSList *table_name_list,
* 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 @@ init_sql_backend( GncDbiBackend* dbi_be )
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;