mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 799487 - Unable to save gnucash DB file as XML file
Not quite true, it just takes a really long time for a large database. The underlying problem is gnc_file_do_save_as reloads the data to make sure that the save-as saves everything. On the SQL backend that triggers a scrub. The scrub itseld doesn't take long, but every transaction commit was logged in the transaction log and did a refresh of the registers. So: * Suspend logging while doing the scrub. * Suspend UI refreshes and QOF events while reloading the data.
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <gncTaxTable.h>
|
||||
#include <gncInvoice.h>
|
||||
#include <gnc-pricedb.h>
|
||||
#include <TransLog.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -347,8 +348,10 @@ GncSqlBackend::load (QofBook* book, QofBackendLoadType loadType)
|
||||
* m_loading true prevents changes from being written back to the
|
||||
* database. Do that now.
|
||||
*/
|
||||
xaccLogDisable();
|
||||
auto transactions = qof_book_get_collection (book, GNC_ID_TRANS);
|
||||
qof_collection_foreach(transactions, scrub_txn_callback, nullptr);
|
||||
xaccLogEnable();
|
||||
|
||||
/* Mark the session as clean -- though it should never be marked
|
||||
* dirty with this backend
|
||||
|
||||
Reference in New Issue
Block a user