You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2017/05/05 09:24:04 UTC
[jira] [Resolved] (SLING-6782) Sling Job implementation should
avoid unnecessary writes to the repository
[ https://issues.apache.org/jira/browse/SLING-6782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler resolved SLING-6782.
-------------------------------------
Resolution: Fixed
Thanks for your patch, [~jhoh]. It's applied in rev 1793991
I modified the patch a little bit by first creating the parent resource and then the resource itself. This allows to remove the duplicate code
> Sling Job implementation should avoid unnecessary writes to the repository
> --------------------------------------------------------------------------
>
> Key: SLING-6782
> URL: https://issues.apache.org/jira/browse/SLING-6782
> Project: Sling
> Issue Type: Improvement
> Components: Event
> Affects Versions: Event 4.2.2
> Reporter: Jörg Hoh
> Assignee: Carsten Ziegeler
> Fix For: Event 4.2.4
>
> Attachments: SLING-6782-jobs-commit-to-often-2.patch, SLING-6782-jobs-commit-to-often.patch
>
>
> I found in a number of occurences in the Sling Event code this pattern:
> {code}
> ResourceHelper.getOrCreateResource(resolver, newPath, props);
> resolver.delete(jobResource);
> resolver.commit();
> {code}
> and the getOrCreateResource is internally doing a commit on the resolver (autoCommit = true). So in the end there are 2 commits while only a single commit would be sufficient.
> Removing these "double" commits could avoid a few write operations on the repository.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)