Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #485324 +++ A popup "Cannot modify resource set without a write transaction" is displayed when exporting as image for the diagram in attachment. Scenario to reproduce : 1. Import projects from the attached archive 2. Launch a runtime from them 3. Import AQLBug.test in this second runtime 4. Open the diagram 5. Export as diagram using the action from tabbar => KO the popup appears The popup appears because of IllegalStateException which is thrown from TransactionChangeRecorder.assertWriting() because DiagramDialectUIServices .synchronizeDiagram() is not called in a EMF Command. In addition non GMF model change is done by DDiagramCanonicalSynchronizer, it is only a touch notification from RegionContainerUpdateLayoutOperation which could be avoided.
DiagramDialectUIServices.export does a canonical refresh before creating the offscreen diagram edit part to do the export. This canonical refresh is not safe as it is executed out of a transaction (no precommit calls, if the model is modified "cannot write resource without transaction" ISE, model modified but opened editor not refresh by postcommits, ...) See coments on https://git.eclipse.org/r/#/c/63697/1 The possibility to execute the canonical refresh in a transaction then leads to several questions: . who create the transaction ? The diagramDialectUIServices.export must be consistent with the others dialects and services of DialectUIServices . can the export add a command on the undo stack, what is the meaning of this undo: also delete the created file(s) ? . if we do a canonical refresh, why do we not do a full refresh (and same question for table and tree) , or should be detect that there is a problem and ask the user to refresh its representation ? Note that the action is used for the export from the aird contextual menu and from the tabbar.