MODE-1136 Corrected lock and unlock handling in graph batches #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Graph.Batch methods related to locking and unlocking were incorrectly being processed immediately rather than being added to the batch (like all other operations). This results in extra sets of operations being pushed to the connector, and inconsistent/incorrect behavior and possible re-ordering of the individual requests.
This change corrects this behavior. When the Graph.Batch operations were changed to correctly use the batch, several unit and TCK tests related to observation failed. Apparently, there was some checks inside JcrObservationManager that was ignoring all net changes for a node if the net change included any lock or unlock operations. Obviously, if the net change included a lock operation and some other operations (e.g., update properties), then these other operations would be ignored and not converted into the appropriate events. Simply removing that check made this work.
After these changes were made, all unit and integration tests pass again.