[jira] [Updated] (SLING-6782) Sling Job implementation should avoid unnecessary writes to the repository

2017-05-01 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-6782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler updated SLING-6782:

Fix Version/s: Event 4.2.4

> 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
> 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)


[jira] [Updated] (SLING-6782) Sling Job implementation should avoid unnecessary writes to the repository

2017-04-19 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SLING-6782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jörg Hoh updated SLING-6782:

Attachment: SLING-6782-jobs-commit-to-often-2.patch

> 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
> 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)


[jira] [Updated] (SLING-6782) Sling Job implementation should avoid unnecessary writes to the repository

2017-04-18 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SLING-6782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jörg Hoh updated SLING-6782:

Description: 
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.

  was:
I found in a number of occurences 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.


> 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
> Attachments: 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)


[jira] [Updated] (SLING-6782) Sling Job implementation should avoid unnecessary writes to the repository

2017-04-18 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SLING-6782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jörg Hoh updated SLING-6782:

Attachment: SLING-6782-jobs-commit-to-often.patch

I introduced another helper method, which allows to set the autoCommit to 
false. We are able to use this new helper method in 7 occassions.

Patch attached.

> 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
> Attachments: SLING-6782-jobs-commit-to-often.patch
>
>
> I found in a number of occurences 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)