mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user