EMF attribute cannot be set [message #24215] |
Sun, 20 August 2006 11:11  |
Eclipse User |
|
|
|
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 #30978 is a reply to message #25057] |
Sat, 26 August 2006 12:33  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03372 seconds