Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] View invalidation causes severe problems with Adapters
[CDO] View invalidation causes severe problems with Adapters [message #1753478] Mon, 06 February 2017 22:41 Go to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 306
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi,
I just realized that due to the fix of this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=363355

deleted objects in a view get invalidated before the delta notifications are send to dirty objects. This means that all adapters that are attached to dirty objects must be able to handle invalid objects. Especially EContentAdapters have a problem because during iteration of the content tree invalidated objects may be encountered which will by default be created by the CDOView as StaleReferenceProxies (see exeption below). Other adapters that access invalid objects may also fail because the unexpectedly get a proxy instead of a real object. Since there may be a lot of adapters involved in an application it is really hard to tackle this.

Does anybody has encountered similar problems?

Thanks in advance
Thorsten

java.lang.IllegalStateException: Unable to provide ID: null
	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDOID(AbstractCDOView.java:2189)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.provideCDOID(CDOTransactionImpl.java:3544)
	at org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$DynamicProxy$1.invoke(CDOStaleReferencePolicy.java:207)
	at com.sun.proxy.$Proxy21.equals(Unknown Source)
	at org.eclipse.net4j.util.ObjectUtil.equals(ObjectUtil.java:46)
	at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.isSet(CDOStoreImpl.java:251)
	at org.eclipse.emf.internal.cdo.CDOObjectImpl.eDynamicIsSet(CDOObjectImpl.java:741)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eIsSet(BasicEObjectImpl.java:1257)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eIsSet(BasicEObjectImpl.java:1241)
	at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.hasNext(EContentsEList.java:437)
	at org.eclipse.emf.ecore.util.EContentAdapter.unsetTarget(EContentAdapter.java:314)
	at enco.sox2.emf.model.AbstractDocumentAdapter.unsetTarget(AbstractDocumentAdapter.java:242)
	at org.eclipse.emf.ecore.util.EContentAdapter.unsetTarget(EContentAdapter.java:288)
	at org.eclipse.emf.ecore.util.EContentAdapter.unsetTarget(EContentAdapter.java:267)
	at org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didRemove(MinimalEObjectImpl.java:527)
	at org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didRemove(MinimalEObjectImpl.java:1)
	at org.eclipse.emf.common.util.ArrayDelegatingEList.remove(ArrayDelegatingEList.java:658)
	at org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:462)
	at org.eclipse.emf.ecore.util.EContentAdapter.removeAdapter(EContentAdapter.java:388)
	at org.eclipse.emf.ecore.util.EContentAdapter.removeAdapter(EContentAdapter.java:383)
	at org.eclipse.emf.ecore.util.EContentAdapter.handleContainment(EContentAdapter.java:162)
	at org.eclipse.emf.ecore.util.EContentAdapter.selfAdapt(EContentAdapter.java:77)
	at enco.sox2.emf.model.AbstractDocumentAdapter.selfAdapt(AbstractDocumentAdapter.java:101)
	at org.eclipse.emf.ecore.util.EContentAdapter.notifyChanged(EContentAdapter.java:43)
	at enco.sox2.emf.model.AbstractDocumentAdapter.notifyChanged(AbstractDocumentAdapter.java:140)
	at enco.sox2.fmea.util.FMEADocumentAdapter.notifyChanged(FMEADocumentAdapter.java:261)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.emf.common.notify.impl.NotificationChainImpl.dispatch(NotificationChainImpl.java:98)
	at org.eclipse.emf.common.notify.impl.NotificationChainImpl.dispatch(NotificationChainImpl.java:86)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.sendDeltaNotifications(CDOViewImpl.java:1364)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.doInvalidateSynced(CDOViewImpl.java:1240)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.doInvalidate(CDOViewImpl.java:1186)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl$InvalidationRunnable.doRun(CDOViewImpl.java:2823)
	at org.eclipse.net4j.util.concurrent.RunnableWithName.run(RunnableWithName.java:53)
	at org.eclipse.net4j.util.concurrent.ExecutorWorkSerializer$1.run(ExecutorWorkSerializer.java:104)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Re: [CDO] View invalidation causes severe problems with Adapters [message #1753491 is a reply to message #1753478] Tue, 07 February 2017 07:51 Go to previous messageGo to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 306
Registered: February 2012
Location: Düsseldorf
Senior Member
I just figured out that the bug mentioned above only changes the order of managing detached and changed objects during invalidation. This doesn't have to do anything with this issue.

Still I think that it is a severe issue that objects are invalidated before they get notified. On the client that initiates the invalidation the order is different. First all objects get notified by their adapters then objects are invalidated.
Re: [CDO] View invalidation causes severe problems with Adapters [message #1753570 is a reply to message #1753491] Tue, 07 February 2017 18:09 Go to previous message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 306
Registered: February 2012
Location: Düsseldorf
Senior Member
Ok meanwhile I realized why it is mandatory to invalidate the objects prior to notification. Nevertheless these invalid objects are a problem for EContentAdapters because they may run into IllegalStateException when they try to iterate over invalid content.
I found a way to provide these objects during invalidation by making use of a specific CDOStaleReferencePolicy.
Previous Topic:OCLinEcore and ATL
Next Topic:DefaultDetailComposite related dependencies
Goto Forum:
  


Current Time: Fri Jul 20 12:54:11 GMT 2018

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

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

Back to the top