You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Joerg Hoh (Jira)" <ji...@apache.org> on 2024/03/11 09:58:00 UTC

[jira] [Created] (OAK-10706) Session.save() should check first if there are pending changes

Joerg Hoh created OAK-10706:
-------------------------------

             Summary: Session.save() should check first if there are pending changes
                 Key: OAK-10706
                 URL: https://issues.apache.org/jira/browse/OAK-10706
             Project: Jackrabbit Oak
          Issue Type: Task
          Components: jcr
    Affects Versions: 1.60.0
            Reporter: Joerg Hoh


Currently Session.save() works under the assumption that there are changes to be committed. That means there is some static runtime overhead, even if no changes are to be committed.

For that reason it's common to use this pattern to avoid this operation if nothing is to be saved.

{noformat}
if (session.hasPendingChanges()) {
  session.save();
}
{noformat}

But it would be really great if Oak would do this check internally, and avoid the overhead if there's nothing to save at all.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)