Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 499225

Summary: Transaction policies should provide a mechanism for disabling the local execution of operations.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: 1.0.0   
Target Milestone: 5.0.0 (Oxygen) M6   
Hardware: All   
OS: All   
Whiteboard:

Description Matthias Wienand CLA 2016-08-05 07:29:52 EDT
When performing complex changes using multiple transaction policies and bundling these changes in a composite operation so that they can be performed in a specified order, the local execution of operations by the transaction policies changes the state prior to the execution of all operations. This can lead to errors because the changes are not necessarily performed in the specified order. Therefore, a mechanism should be provided that can be used to disable the local execution of operations by transaction policies.

Per default, the local execution is okay, because one interaction policy usually accesses one transaction policy for performing its changes.
Comment 1 Matthias Wienand CLA 2016-09-12 06:49:51 EDT
I added a mechanism similar to AbstractVisualPart#isRefreshVisual(), #setRefreshVisual(), #refreshVisual(), and #doRefreshVisual(). Thus, I added the following methods to AbstractTransactionPolicy:
 - public isLocallyExecuteOperation() : boolean
 - public setLocallyExecuteOperation(boolean)
 - public final locallyExecuteOperation()
 - protected doLocallyExecuteOperation()

The local execution of the transactional operation is enabled per default, and the flag is cleared (i.e. set to true) when the policy is initialized.

The code is published on the master branch, therefore, I resolve this ticket as fixed for 5.0.0 M2.
Comment 2 Alexander Nyßen CLA 2017-03-08 03:43:45 EST
Reverted the change. As locallyExecuteOperation is not final, subclasses may add respective behavior if needed. Ensured however, that during commit and rollback, local execution/undo do not break the initialized state.
Comment 3 Alexander Nyßen CLA 2017-03-08 03:44:11 EST
The changes are effective for 5.0.0 M6.