[
https://issues.apache.org/jira/browse/SLING-12264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825199#comment-17825199
]
Joerg Hoh commented on SLING-12264:
-----------------------------------
Good point, but when I dug into the first few levels of the Oak implementation
of session.save() I did not find any hint which made me think that it actually
checks for any pending change first.
Also I consistently used this pattern
{noformat}
if (session.hasPendingChanges()) {
session.save();
}
{noformat}
if I was unsure if anything was changed at all, and noone pointed it out as
problematic.
But you are right, one could expect that the JCR implementation does that check
internally to avoid unnecessary work.
> check save() operations
> -----------------------
>
> Key: SLING-12264
> URL: https://issues.apache.org/jira/browse/SLING-12264
> Project: Sling
> Issue Type: Task
> Components: Repoinit
> Affects Versions: Repoinit JCR 1.1.46
> Reporter: Joerg Hoh
> Priority: Major
>
> Before doing a session.save() operation, it should always be checked if there
> is something to save at all.
> This can speed up the execution of individual repoinit statements if the
> repoinit statement does not need to be applied.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)