|
Re: How to access EMF objects into a transaction [message #1062956 is a reply to message #1062883] |
Tue, 11 June 2013 14:18 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
As this is the Xtext forum, I suppose your EMF model is based on Xtext.
As you are talking about the reconciler, I suppose your model is in an
editor.
=> you can use XtextDocument#modify() and encapsulate your changes in a
single IUnitOfWork
Am 11.06.13 10:58, schrieb Marco Naddeo:
> Hi all. :)
>
> Is there a way to execute some operations on EMF objects into a
> transaction?
>
> I worry that the operations that I do on EMF objects (for scoping,
> labeling, and so on) are interleaved with those of the reconciler, so I
> obtain some
> org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException.
>
> My fear is that the reconciler refreshes the model in another thread and
> so while I try to access it, the old model does not exist anymore (and
> so I have, for example, empty Elists).
>
> How can I execute my operations on EMF model into an atomic transaction?
>
>
> Thanks in advance,
> Marco
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
|
Re: How to access EMF objects into a transaction [message #1063129 is a reply to message #1062975] |
Wed, 12 June 2013 12:37 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
How do you get the resource / EObject? My proposal was based on the fact
that you have the model loaded in an Xtext editor. Then it is
XtextEditor#getDocument().
Can you elaborate from where you want to modify the model?
Am 11.06.13 17:01, schrieb Marco Naddeo:
> Ok, and how can I get the XtextDocument starting from an EObject of the
> model, or from the resource?
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Powered by
FUDForum. Page generated in 0.03135 seconds