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

XWIKI-22782: Only save modified xobjects #3798

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmortagne
Copy link
Member

@tmortagne tmortagne commented Jan 14, 2025

Jira URL

https://jira.xwiki.org/browse/XWIKI-22782

Changes

Description

  • added a flag to track if a BaseObject was modified
  • made sure that any modification of something in that BaseObject (properties, direct metadata of that object) update this flag
  • when saving the document skip any BaseObject which indicate that it was not modified
  • had to do some Serializable cleanup (revapi was getting a bit lost). It's not even clear to me why BaseElement and its derivatives are Serializable in the first place, but that's another story…

Clarifications

The general idea is to try to reduce the useless requests during document save. This pull request is focusing in making sure we don't re-save xobject which are identical to what's in the database already.

The save side of things is the easy part, most of the changes in the pull request are about trying to make sure we properly track modifications made to objects.

To avoid problems with complex use cases, this optimization is only applied if the document isChangeTracked() is true, and currently this is false by default and set to true only by the hibernate store when loading a document.

Executed Tests

Counting on existing test to validate that at least there is no regression.

TODO: various unit tests to check the behavior of the new BaseObject (actually BaseElement, since BaseObject is not the only element with this concept) dirty flag.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches: stable-16.10.x

@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch 2 times, most recently from e13046d to 009d360 Compare January 15, 2025 09:30
@tmortagne tmortagne self-assigned this Jan 15, 2025
@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch 3 times, most recently from 1b98e9e to 081a360 Compare January 22, 2025 15:59
@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch from 081a360 to f1b0fa8 Compare January 31, 2025 09:50
@tmortagne tmortagne marked this pull request as ready for review January 31, 2025 10:08
@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch 2 times, most recently from 925a806 to 57a0528 Compare February 9, 2025 16:42
@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch from 57a0528 to f5af05c Compare February 10, 2025 12:22
@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch 3 times, most recently from e750d19 to 71756b8 Compare February 11, 2025 10:26
@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch from 71756b8 to 0587cb0 Compare February 11, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants