Illegal State Exception with EMF Transaction [message #1736979] |
Mon, 04 July 2016 18:52 |
Delacyr Ferreira Messages: 20 Registered: February 2016 |
Junior Member |
|
|
Hi folks!
I'm getting stuck with a kind of write transaction problem. Every resource modification I made at my model, like delete, move, create shapes, I've been used EMF Transaction to do it. Now I'm getting java.lang.IllegalStateException: Cannot modify resource set without a write transaction message, but I don't know why, even using TransactionalEditingDomain.
This is the Instantiate class (Lines 397, 475, 889) that I'm having problem. And to help understand the problem, this is the console output (Lines 60, 166 and 172) with the IllegalStateException.
I wonder if someone can help me understand what is happening. If someone have any idea about this problem, I'll be grateful.
Thank you.
|
|
|
Re: Illegal State Exception with EMF Transaction [message #1736990 is a reply to message #1736979] |
Mon, 04 July 2016 23:23 |
|
Hi,
I can see in the first stack trace that you linked
(http://git.ledes.net/snippets/7#L60) that the problem is in an
EditPart in the diagram editor trying to make changes during its
refresh.
In reaction to changes done by your command execution at line 60,
farther down the stack that command's transaction is committing at line
53. During the commit process, listeners interested in the
Notifications that describe changes performed by the command are
invoked in a *read-only* transaction. This gives listeners exclusive
read access to the model in order to inspect its current state. It is
during this read-only transaction after the command's own transaction
has committed that an EditPart is trying to execute a new command, but
you can't create a read/write transaction while a read-only transaction
is active.
Refreshing the visual presentation of a diagram edit-part shouldn't
usually need to update the model, but I know nothing about your
application, so it's hard to comment on that.
HTH,
Christian
On 2016-07-04 18:52:13 +0000, Delacyr Ferreira said:
> Hi folks!
>
> I'm getting stuck with a kind of write transaction problem. Every
> resource modification I made at my model, like delete, move, create
> shapes, I've been used EMF Transaction to do it. Now I'm getting
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction message, but I don't know why, even using
> TransactionalEditingDomain.
>
> This is the http://git.ledes.net/snippets/4 (Lines 397, 475, 889) that
> I'm having problem. And to help understand the problem, this is the
> http://git.ledes.net/snippets/7#L60 (Lines 60, 166 and 172) with the
> IllegalStateException.
>
> I wonder if someone can help me understand what is happening. If
> someone have any idea about this problem, I'll be grateful.
>
> Thank you.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03932 seconds