[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: read-only transaction context problem

Sascha, thanks for your answer. However, it is not exactly working. See below.

Sascha Geßler schrieb:
However, the following code results in a
java.lang.IllegalStateException: Cannot activate read/write transaction in read-only transaction context

Please note that the constructor of a RecordingCommand needs an TransactionalEditingDomain (which can be acquired from many GMF elements, for example by IGraphicalEditPart.getEditingDomain()).The editing domain also provides access to the command stack that should be used to execute the command.


Executing your RecordingCommand on this CommandStack should provide you with an valid read/write transaction.


Whatever command I use, the problem is always the same. I tried a SetCommand, a RecordingCommand or a custom command.

The problem is, that in my situation, the CommandStack I get from the corresponding EObject is in a read-only state, i.e. the EditingDomain has an active read-only transaction. So my write command triggers that exception.

The thing is, that I want to tell the CommandStack then to execute the command *after* the read-only transaction has been run through... How can I do that? There must be a way...

Hauke