Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF Command(Transaction is already closed problem)
GMF Command [message #1186904] Thu, 14 November 2013 23:21 Go to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Hi all,

When my model changed i want to delete its childs from diagram and emf so i write;

	 * @not generated
	public void handleNotificationEvent(Notification notification) {
		if (notification.getNotifier() instanceof Grid)
			switch (notification.getFeatureID(Grid.class)) {
			case FormPackage.GRID__CONTENT_FIELD:
				Grid grid = (Grid) notification.getNotifier();

				if (grid.getColumns() != null && !grid.getColumns().isEmpty()) {
					CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
							getEditingDomain(), null);
					for (int i = 0; i < grid.getColumns().size(); i++) {				
						GridColumn column = (GridColumn) grid.getColumns().get(
						DestroyElementRequest request = new DestroyElementRequest 
								(column, false);
						cmd.add(new DestroyElementCommand(request));
					getDiagramEditDomain().getDiagramCommandStack().execute(new ICommandProxy(cmd));	

this handleNotificationEvent but i always get error but dont understand why this code don't work. Anyone can help me ?

Caused by: java.lang.IllegalStateException: Transaction is already closed
	at org.eclipse.emf.transaction.impl.TransactionImpl.rollback(
	at org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory$DiagramEditingDomain.postcommit(
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(
	at org.eclipse.emf.transaction.impl.TransactionImpl.close(
	at org.eclipse.emf.transaction.impl.TransactionImpl.commit(
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(
	at org.eclipse.core.commands.operations.TriggeredOperations.execute(
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute( ...


[Updated on: Thu, 14 November 2013 23:51]

Report message to a moderator

Re: GMF Command [message #1200447 is a reply to message #1186904] Thu, 21 November 2013 08:45 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member

did you try using a EMF Delete or Remove Command? (

Previous Topic:How to implement something like gantt chart using GMF?
Next Topic:Reducing 2 Palette Tools to 1 Tool
Goto Forum:

Current Time: Thu Feb 25 01:59:46 GMT 2021

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

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

Back to the top