Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Illegal State Exception with EMF Transaction(Cannot modify resource set without a write transaction)
Illegal State Exception with EMF Transaction [message #1736979] Mon, 04 July 2016 18:52 Go to next message
Delacyr Ferreira is currently offline Delacyr FerreiraFriend
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 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1249
Registered: July 2009
Location: Canada
Senior Member

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.
Re: Illegal State Exception with EMF Transaction [message #1737124 is a reply to message #1736990] Tue, 05 July 2016 23:31 Go to previous message
Delacyr Ferreira is currently offline Delacyr FerreiraFriend
Messages: 20
Registered: February 2016
Junior Member
Thank you Christian for your explanation. It helped me understand this exception message.
Previous Topic:StackOverflowError when saving resource
Next Topic:[CDO] Update an historical revision with modification to an up-to-date and commitable revision
Goto Forum:
  


Current Time: Tue Jun 15 11:26:34 GMT 2021

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

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

Back to the top