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

Alexander Klimetschek updated SLING-6932:
-----------------------------------------
    Description: 
All ResourceResolver resource operations (create, delete, move, copy) are 
transient, one always has to call commit() to save the transaction.

This isn't documented in the current [ResourceResolver 
javadoc|https://github.com/apache/sling/blob/96c4134f770c83a665170ec9fad1f8d49832e650/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java].
 A general paragraph in the class level javadoc on the overall transactional 
behavior, plus a sentence on each modifying operation such as "It is necessary 
to call commit() to persist these changes." would help.

Furthermore, with changes across multiple resource providers (such as a move), 
these are multiple transactions, but there is no two phase commit or the like - 
the first failure will stop committing transactions, and already committed 
transactions are not rolled back. (Based on reading [this 
code|https://github.com/apache/sling/blob/96c4134f770c83a665170ec9fad1f8d49832e650/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java#L419-L423]).
 Should be documented as well.

Discussed here: http://sling.markmail.org/thread/vrnjgqgf3djvwscv

  was:
All ResourceResolver resource operations (create, delete, move, copy) are 
transient, one always has to call commit() to save the transaction.

This isn't documented in the current [ResourceResolver 
javadoc|https://github.com/apache/sling/blob/96c4134f770c83a665170ec9fad1f8d49832e650/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java].
 A general paragraph in the class level javadoc on the overall transactional 
behavior, plus a sentence on each modifying operation such as "It is necessary 
to call commit() to persist these changes." would help.

Furthermore, with changes across multiple resource providers (such as a move), 
these are multiple transactions, but there is no two phase commit or the like - 
the first failure will stop committing transactions, and already committed 
transactions are not rolled back. (Based on reading [this 
code|https://github.com/apache/sling/blob/96c4134f770c83a665170ec9fad1f8d49832e650/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java#L419-L423]).
 Should be clarified as well.

Discussed here: http://sling.markmail.org/thread/vrnjgqgf3djvwscv


> [javadoc] Document transient nature of ResourceResolver operations
> ------------------------------------------------------------------
>
>                 Key: SLING-6932
>                 URL: https://issues.apache.org/jira/browse/SLING-6932
>             Project: Sling
>          Issue Type: Improvement
>          Components: API
>            Reporter: Alexander Klimetschek
>
> All ResourceResolver resource operations (create, delete, move, copy) are 
> transient, one always has to call commit() to save the transaction.
> This isn't documented in the current [ResourceResolver 
> javadoc|https://github.com/apache/sling/blob/96c4134f770c83a665170ec9fad1f8d49832e650/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java].
>  A general paragraph in the class level javadoc on the overall transactional 
> behavior, plus a sentence on each modifying operation such as "It is 
> necessary to call commit() to persist these changes." would help.
> Furthermore, with changes across multiple resource providers (such as a 
> move), these are multiple transactions, but there is no two phase commit or 
> the like - the first failure will stop committing transactions, and already 
> committed transactions are not rolled back. (Based on reading [this 
> code|https://github.com/apache/sling/blob/96c4134f770c83a665170ec9fad1f8d49832e650/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java#L419-L423]).
>  Should be documented as well.
> Discussed here: http://sling.markmail.org/thread/vrnjgqgf3djvwscv



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to