Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 799487 - Unable to save gnucash DB file as XML file #2052

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

jralls
Copy link
Member

@jralls jralls commented Dec 18, 2024

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 while reloading the data.
  • Make the register page event handler obey the refresh being suspended.

@Bob-IT I'm a bit concerned about that last bullet: Is there a reason that gnc_plugin_page_register_event_handler doesn't respect the suspend? Or is it that none of the handlers check whether the GUI is suspended because suspension is supposed to be handled somewhere else?

@Bob-IT
Copy link
Contributor

Bob-IT commented Dec 18, 2024

I would need to check this but I think it is how the handler was registered, there seems to be two ways either with qof_event_register_handler or gnc_register_gui_component. I think with the second method, the gui suspend level is checked but with the first function it is a different suspend level.

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.
@jralls
Copy link
Member Author

jralls commented Dec 22, 2024

I think with the second method, the gui suspend level is checked but with the first function it is a different suspend level.

Right, qof_event_suspend and qof_event_resume. I bracketed the data reload with those instead of checking for gui refreshes being suspended in gnc_plugin_page_register_event_handler. It's more appropriate too because that latter function doesn't actually do a UI refresh in the normal sense: It does a ton of stuff that looks to me like it should be done once in gnc_plugin_page_register_init. Doing it every time a QOF Event fires seems insane.

@code-gnucash-org code-gnucash-org merged commit bda17ff into Gnucash:stable Dec 23, 2024
4 checks passed
@jralls jralls deleted the bug799487 branch December 23, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants