Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338385 - Save process of EMTLResource should work with EMF Transaction
Summary: Save process of EMTLResource should work with EMF Transaction
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: All All
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-28 05:13 EST by Mariot Chauvin CLA
Modified: 2011-04-11 11:44 EDT (History)
1 user (show)

See Also:
mariot.chauvin: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mariot Chauvin CLA 2011-02-28 05:13:31 EST
Currently save process of EMTLResource do a model modification in its save method. This is not expected by EMF Transaction and it's not advised in a general way

See http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg31691.html

Here is the stacktrace :

java.lang.IllegalStateException: Cannot modify resource set without a write transaction
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processResourceNotification(TransactionChangeRecorder.java:272)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:238)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.dispatchNotification(NotifyingListImpl.java:267)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:300)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307)
at org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.getPositions(EMtlResourceImpl.java:252)
at org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doSave(EMtlResourceImpl.java:95)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1406)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithFileBuffer(ResourceImpl.java:1017)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:976)
Comment 1 Stephane Begaudeau CLA 2011-03-08 08:59:45 EST
Thanks to a piece of code from cbrun (eSetDeliver(false); ... eSetDeliver(true);) this should not be a problem anymore. I will test it with Acceleo 3.1 M6 next week.
Comment 2 Stephane Begaudeau CLA 2011-04-11 11:44:25 EDT
Acceleo does not send any notifications during the saving process anymore. The fix will be available in Acceleo 3.1.0M7.