Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Databinding & Transactional Editing Domain
Databinding & Transactional Editing Domain [message #730946] Thu, 29 September 2011 15:18 Go to next message
Matteo Miraz is currently offline Matteo MirazFriend
Messages: 38
Registered: March 2011
Member
Hi,

I'm creating an application that needs a transactional editing domain (leverages XText & Graphiti). In this application I need to create some data-entry page, allowing the user to inspect and change parts of the model. I would like to use the databinding functionality to link the JFace GUI elements with the underlying model. Since I'm not an expert in this field, I used the WindowBuilder wizards. Everything works correctly if the element is not inserted in any Resource (e.g., in those wizards that provide the user with the ability to create new elements). However, as soon as the element is inserted in a resource (directly or by containment relationships) everything stop working and the following exception is thrown:

java.lang.IllegalStateException: Cannot modify resource set without a write transaction children=[Status ERROR: org.eclipse.core.databinding code=0 An error occurred while setting the value. java.lang.IllegalStateException: Cannot modify resource set without a write transaction]

For this reason, it seems to me that my basic databinding does not use any transactional editing domain... does anybody have successfully created a databinding with a transactional resource?

Thanks for any help!

--
Matteo
Re: Databinding & Transactional Editing Domain [message #730950 is a reply to message #730946] Thu, 29 September 2011 15:21 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
* EMFProperties / EMFObservables directly use eGet/eSet/List-API
* EMFEditProperties / EMFEditObservables goes through the provided
EditingDomain using Commands

=> You need to use EMFEditProperties / EMFEditObservables

Tom

Am 29.09.11 17:18, schrieb Matteo:
> Hi,
>
> I'm creating an application that needs a transactional editing domain
> (leverages XText & Graphiti). In this application I need to create some
> data-entry page, allowing the user to inspect and change parts of the
> model. I would like to use the databinding functionality to link the
> JFace GUI elements with the underlying model. Since I'm not an expert in
> this field, I used the WindowBuilder wizards. Everything works correctly
> if the element is not inserted in any Resource (e.g., in those wizards
> that provide the user with the ability to create new elements). However,
> as soon as the element is inserted in a resource (directly or by
> containment relationships) everything stop working and the following
> exception is thrown:
>
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction children=[Status ERROR: org.eclipse.core.databinding
> code=0 An error occurred while setting the value.
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction]
>
> For this reason, it seems to me that my basic databinding does not use
> any transactional editing domain... does anybody have successfully
> created a databinding with a transactional resource?
>
> Thanks for any help!
>
> --
> Matteo
Re: Databinding & Transactional Editing Domain [message #730959 is a reply to message #730946] Thu, 29 September 2011 15:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Matteo,

Are you using EMFEditObservables? That will certainly be necessary to
get this working, but I saw this question about using EMFEditObservables
verses EMFObservables in the WindowBuilder forum yesterday and that's
not currently supported. You might look into using EEF...


On 29/09/2011 8:18 AM, Matteo wrote:
> Hi,
>
> I'm creating an application that needs a transactional editing domain
> (leverages XText & Graphiti). In this application I need to create
> some data-entry page, allowing the user to inspect and change parts of
> the model. I would like to use the databinding functionality to link
> the JFace GUI elements with the underlying model. Since I'm not an
> expert in this field, I used the WindowBuilder wizards. Everything
> works correctly if the element is not inserted in any Resource (e.g.,
> in those wizards that provide the user with the ability to create new
> elements). However, as soon as the element is inserted in a resource
> (directly or by containment relationships) everything stop working and
> the following exception is thrown:
>
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction children=[Status ERROR: org.eclipse.core.databinding
> code=0 An error occurred while setting the value.
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction]
>
> For this reason, it seems to me that my basic databinding does not use
> any transactional editing domain... does anybody have successfully
> created a databinding with a transactional resource?
>
> Thanks for any help!
>
> --
> Matteo


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Databinding & Transactional Editing Domain [message #730967 is a reply to message #730959] Thu, 29 September 2011 15:55 Go to previous message
Matteo Miraz is currently offline Matteo MirazFriend
Messages: 38
Registered: March 2011
Member
Hi,

Tom was right: I was using EMFObservables. With EMFEditObservables everything is ok!

Ed, I saw EEF, but I was afraid to mix so many new projects (new for me, I mean Smile ). Now that everything starts working, I will give EEF a try!

Thanks,
Matteo
Re: Databinding & Transactional Editing Domain [message #730982 is a reply to message #730959] Thu, 29 September 2011 15:55 Go to previous message
Matteo is currently offline MatteoFriend
Messages: 23
Registered: July 2009
Junior Member
Hi,

Tom was right: I was using EMFObservables. With EMFEditObservables everything is ok!

Ed, I saw EEF, but I was afraid to mix so many new projects (new for me, I mean :) ). Now that everything starts working, I will give EEF a try!

Thanks,
Matteo
Previous Topic:Proxy resolution in case of Abstract types
Next Topic:Line separators in the Sample Ecore Model Editor
Goto Forum:
  


Current Time: Thu Apr 25 01:07:10 GMT 2024

Powered by FUDForum. Page generated in 0.03301 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top