Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » EMF attribute cannot be set
EMF attribute cannot be set [message #24215] Sun, 20 August 2006 11:11 Go to next message
Eclipse UserFriend
Originally posted by: George.Z.Lei.gmail.com

Hi all,

When I set the attribute value of the EMF model from my edit parts, an
exception was always catched internally. The exception is as following

java.lang.IllegalStateException: Cannot modify resource set without a write
transaction

It happened when the model finished setting value for attribute and was
firing a notification. During the process, a transaction object was
retrieved and validated, and the transaction is readonly, therefore the
exception was thrown.

Who can help me to analyze the cause for the exception?


Thanks,
George
Re: EMF attribute cannot be set [message #25057 is a reply to message #24215] Mon, 21 August 2006 16:42 Go to previous messageGo to next message
Eclipse UserFriend
George Lei wrote:
> Hi all,
>
> When I set the attribute value of the EMF model from my edit parts, an
> exception was always catched internally. The exception is as following
>
> java.lang.IllegalStateException: Cannot modify resource set without a write
> transaction
>
> It happened when the model finished setting value for attribute and was
> firing a notification. During the process, a transaction object was
> retrieved and validated, and the transaction is readonly, therefore the
> exception was thrown.
>
> Who can help me to analyze the cause for the exception?
>
>
> Thanks,
> George
>
>
You have to open a write transaction before doing any model changes
You will need to check who was trying to change the attribute without
having a write transaction
Re: EMF attribute cannot be set [message #30978 is a reply to message #25057] Sat, 26 August 2006 12:33 Go to previous message
Eclipse UserFriend
Originally posted by: George.Z.Lei.gmail.com

"Mohammed Mostafa" <mmostafa@ca.ibm.com> wrote in message
news:ecd5sj$lsn$1@utils.eclipse.org...
> George Lei wrote:
> > Hi all,
> >
> > When I set the attribute value of the EMF model from my edit parts, an
> > exception was always catched internally. The exception is as following
> >
> > java.lang.IllegalStateException: Cannot modify resource set without a
write
> > transaction
> >
> > It happened when the model finished setting value for attribute and was
> > firing a notification. During the process, a transaction object was
> > retrieved and validated, and the transaction is readonly, therefore the
> > exception was thrown.
> >
> > Who can help me to analyze the cause for the exception?
> >
> >
> > Thanks,
> > George
> >
> >
> You have to open a write transaction before doing any model changes
> You will need to check who was trying to change the attribute without
> having a write transaction

In fact I am trying to set some model attribute in the constructor of edit
part. Maybe it is not a good idea.
Is there any better solution to set the attributes when the edit part is
created?

Thanks,
George
Previous Topic:Diagrams on Paper to Ecore
Next Topic:open a new diagram using OpenDiagramPolicy
Goto Forum:
  


Current Time: Mon May 12 03:40:39 EDT 2025

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

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

Back to the top