Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » avoid assertWriting check?
avoid assertWriting check? [message #105944] Fri, 04 January 2008 07:51 Go to next message
Eclipse UserFriend
Originally posted by: klammer.utanet.at

I would like to use the TransactionalEditingDomain for workspace
Undo/Redo support. But since some operations are executed not via a
command (this operations must not be undoable) the
TransactionChangeRecorder throws an IllegalStateException: "Error
opening the editor.
Cannot modify resource set without a write transaction"

Is it possible to disable the assertWriting check temporarily?

Claus
Re: avoid assertWriting check? [message #105971 is a reply to message #105944] Fri, 04 January 2008 11:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------080504040403000606030807
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Claus,

The Transaction stuff has graduated from incubation and is part of EMF
proper now, so best to ask about it on the EMF newsgroup. If you have
something that modifies the state, that's potentially going to
invalidate the assumptions of the command on the stack which generally
assumes that *nothing *changes except via commands so all objects are in
the expected state when an attempted is made to undo a previous change.
Are you sure you shouldn't be using something like a RecordingCommand
and specializing the doExecute method in order to perform your operation
while a change recorder monitors the activity so that the changes will
in fact be undoable and redoable despite the fact that you didn't use
commands to effect the changes? Because of the previous point about
assuming the state is never modified, I think minimally you'd have to
execute your operation as a command that's not undoable...


Claus Klammer wrote:
> I would like to use the TransactionalEditingDomain for workspace
> Undo/Redo support. But since some operations are executed not via a
> command (this operations must not be undoable) the
> TransactionChangeRecorder throws an IllegalStateException: "Error
> opening the editor.
> Cannot modify resource set without a write transaction"
>
> Is it possible to disable the assertWriting check temporarily?
>
> Claus


--------------080504040403000606030807
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Claus,<br>
<br>
The Transaction stuff has graduated from incubation and is part of EMF
proper now, so best to ask about it on the EMF newsgroup.
Re: avoid assertWriting check? [message #106050 is a reply to message #105971] Fri, 04 January 2008 13:58 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Ed, Claus,

An easy way to simply disable undo is to use the Transaction.OPTION_NO_UNDO
option in your command execution. This is useful if the volume of change
would be very large, and consume a lot of memory in the undo history in a
ChangeDescription that your application does not intend to use for
undo/redo.

Of course, you would also want to ensure that the command you are executing
reports that it is not undoable in this case. That effectively snuffs the
command-stack (so it should probably be flushed, then, too).

HTH,

Christian


Ed Merks wrote:

> Claus,
>
> The Transaction stuff has graduated from incubation and is part of EMF
> proper now, so best to ask about it on the EMF newsgroup. If you have
> something that modifies the state, that's potentially going to
> invalidate the assumptions of the command on the stack which generally
> assumes that *nothing *changes except via commands so all objects are in
> the expected state when an attempted is made to undo a previous change.
> Are you sure you shouldn't be using something like a RecordingCommand
> and specializing the doExecute method in order to perform your operation
> while a change recorder monitors the activity so that the changes will
> in fact be undoable and redoable despite the fact that you didn't use
> commands to effect the changes? Because of the previous point about
> assuming the state is never modified, I think minimally you'd have to
> execute your operation as a command that's not undoable...
>
>
> Claus Klammer wrote:
>> I would like to use the TransactionalEditingDomain for workspace
>> Undo/Redo support. But since some operations are executed not via a
>> command (this operations must not be undoable) the
>> TransactionChangeRecorder throws an IllegalStateException: "Error
>> opening the editor.
>> Cannot modify resource set without a write transaction"
>>
>> Is it possible to disable the assertWriting check temporarily?
>>
>> Claus
Re: avoid assertWriting check? [message #613888 is a reply to message #105944] Fri, 04 January 2008 11:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31557
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080504040403000606030807
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Claus,

The Transaction stuff has graduated from incubation and is part of EMF
proper now, so best to ask about it on the EMF newsgroup. If you have
something that modifies the state, that's potentially going to
invalidate the assumptions of the command on the stack which generally
assumes that *nothing *changes except via commands so all objects are in
the expected state when an attempted is made to undo a previous change.
Are you sure you shouldn't be using something like a RecordingCommand
and specializing the doExecute method in order to perform your operation
while a change recorder monitors the activity so that the changes will
in fact be undoable and redoable despite the fact that you didn't use
commands to effect the changes? Because of the previous point about
assuming the state is never modified, I think minimally you'd have to
execute your operation as a command that's not undoable...


Claus Klammer wrote:
> I would like to use the TransactionalEditingDomain for workspace
> Undo/Redo support. But since some operations are executed not via a
> command (this operations must not be undoable) the
> TransactionChangeRecorder throws an IllegalStateException: "Error
> opening the editor.
> Cannot modify resource set without a write transaction"
>
> Is it possible to disable the assertWriting check temporarily?
>
> Claus


--------------080504040403000606030807
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Claus,<br>
<br>
The Transaction stuff has graduated from incubation and is part of EMF
proper now, so best to ask about it on the EMF newsgroup.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: avoid assertWriting check? [message #613900 is a reply to message #105971] Fri, 04 January 2008 13:58 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Ed, Claus,

An easy way to simply disable undo is to use the Transaction.OPTION_NO_UNDO
option in your command execution. This is useful if the volume of change
would be very large, and consume a lot of memory in the undo history in a
ChangeDescription that your application does not intend to use for
undo/redo.

Of course, you would also want to ensure that the command you are executing
reports that it is not undoable in this case. That effectively snuffs the
command-stack (so it should probably be flushed, then, too).

HTH,

Christian


Ed Merks wrote:

> Claus,
>
> The Transaction stuff has graduated from incubation and is part of EMF
> proper now, so best to ask about it on the EMF newsgroup. If you have
> something that modifies the state, that's potentially going to
> invalidate the assumptions of the command on the stack which generally
> assumes that *nothing *changes except via commands so all objects are in
> the expected state when an attempted is made to undo a previous change.
> Are you sure you shouldn't be using something like a RecordingCommand
> and specializing the doExecute method in order to perform your operation
> while a change recorder monitors the activity so that the changes will
> in fact be undoable and redoable despite the fact that you didn't use
> commands to effect the changes? Because of the previous point about
> assuming the state is never modified, I think minimally you'd have to
> execute your operation as a command that's not undoable...
>
>
> Claus Klammer wrote:
>> I would like to use the TransactionalEditingDomain for workspace
>> Undo/Redo support. But since some operations are executed not via a
>> command (this operations must not be undoable) the
>> TransactionChangeRecorder throws an IllegalStateException: "Error
>> opening the editor.
>> Cannot modify resource set without a write transaction"
>>
>> Is it possible to disable the assertWriting check temporarily?
>>
>> Claus
Previous Topic:avoid assertWriting check?
Next Topic:Create two behaviours to add an element in an EMF editor
Goto Forum:
  


Current Time: Wed Oct 28 06:49:28 GMT 2020

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

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

Back to the top