Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322726

Summary: [Dawn] IllegalStateException while closing editor
Product: [Modeling] EMF Reporter: Martin Fluegge <martin.fluegge>
Component: cdo.dawnAssignee: Martin Fluegge <martin.fluegge>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch v1 none

Description Martin Fluegge CLA 2010-08-15 13:48:51 EDT
While closing a Dawn-based editor (and its CDOTransaction) the exception below is thrown. The cause for the exception is already described in Bug 314186. Though the exception has its root in the CDO core itself in this case it is triggered by an unnecessary notifyChanged() call from the DawnTransactionChangeRecorder. So I think in this special case this could be handled in Dawn itself. 


java.lang.IllegalStateException
	at org.eclipse.emf.common.notify.impl.NotificationImpl.getOldBooleanValue(NotificationImpl.java:883)
	at org.eclipse.gmf.runtime.emf.core.resources.GMFResourceModificationManager$1.matches(GMFResourceModificationManager.java:130)
	at org.eclipse.emf.transaction.NotificationFilter$13.matches(NotificationFilter.java:291)
	at org.eclipse.emf.transaction.impl.FilterManager.selectUnbatched(FilterManager.java:144)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl$2.run(TransactionalEditingDomainImpl.java:822)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.broadcastUnbatched(TransactionalEditingDomainImpl.java:818)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:319)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processResourceNotification(TransactionChangeRecorder.java:272)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:238)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleData.dynamicSet(EStructuralFeatureImpl.java:2029)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:1137)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1111)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1081)
	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.setResourceSet(CDOResourceImpl.java:214)
	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.basicSetResourceSet(CDOResourceImpl.java:854)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$ResourcesEList.inverseRemove(ResourceSetImpl.java:595)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.removeAll(NotifyingListImpl.java:951)
	at org.eclipse.emf.internal.cdo.view.CDOViewSetImpl.remove(CDOViewSetImpl.java:171)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl.viewDetached(CDOSessionImpl.java:439)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.doDeactivate(CDOViewImpl.java:1940)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.doDeactivate(CDOTransactionImpl.java:1809)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:125)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:183)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:173)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:199)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.close(CDOViewImpl.java:1823)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl.doDeactivate(CDOSessionImpl.java:1018)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:125)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl$1.onDeactivated(CDOSessionImpl.java:149)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyLifecycleEvent(LifecycleEventAdapter.java:52)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyEvent(LifecycleEventAdapter.java:30)
	at org.eclipse.net4j.util.event.Notifier.fireEventSafe(Notifier.java:133)
	at org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:97)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:132)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl$DelegatingSessionProtocol$1.onDeactivated(CDOSessionImpl.java:1414)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyLifecycleEvent(LifecycleEventAdapter.java:52)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyEvent(LifecycleEventAdapter.java:30)
	at org.eclipse.net4j.util.event.Notifier.fireEventSafe(Notifier.java:133)
	at org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:97)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:132)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:183)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:173)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:199)
	at org.eclipse.spi.net4j.Protocol.handleChannelDeactivation(Protocol.java:159)
	at org.eclipse.net4j.signal.SignalProtocol.handleChannelDeactivation(SignalProtocol.java:329)
	at org.eclipse.spi.net4j.Protocol$1.onDeactivated(Protocol.java:48)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyLifecycleEvent(LifecycleEventAdapter.java:52)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyEvent(LifecycleEventAdapter.java:30)
	at org.eclipse.net4j.util.event.Notifier.fireEventSafe(Notifier.java:133)
	at org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:97)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:132)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:183)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:173)
	at org.eclipse.spi.net4j.ChannelMultiplexer.doDeactivate(ChannelMultiplexer.java:288)
	at org.eclipse.spi.net4j.Connector.doDeactivate(Connector.java:366)
	at org.eclipse.net4j.internal.tcp.TCPConnector.doDeactivate(TCPConnector.java:370)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:125)
	at org.eclipse.net4j.internal.tcp.TCPConnector.handleRead(TCPConnector.java:201)
	at org.eclipse.net4j.internal.tcp.TCPSelector.handleSelection(TCPSelector.java:255)
	at org.eclipse.net4j.internal.tcp.TCPSelector.run(TCPSelector.java:170)
	at java.lang.Thread.run(Thread.java:595)
Comment 1 Martin Fluegge CLA 2010-08-15 15:25:14 EDT
Created attachment 176639 [details]
Patch v1

This fix solves the problem. But actually this is rather a fix basing on the fact that Dawn currently tries to combine the transaction framework CDO offers and the one provided be the TransactionalEditing domain. From CDO point of view it would be better to have a CDO based TransactionalEditingDomain. But until we have something like this fix will work fine ;)
Comment 2 Martin Fluegge CLA 2010-08-15 15:27:29 EDT
Committed to HEAD.
Comment 3 Martin Fluegge CLA 2010-08-24 13:16:54 EDT
Resolved.
Comment 4 Eike Stepper CLA 2011-06-23 04:27:13 EDT
Moving all open problem reports to 4.0
Comment 5 Eike Stepper CLA 2012-09-21 06:51:48 EDT
Closing.