Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMFStore] handling dangling references
[EMFStore] handling dangling references [message #1220263] Tue, 10 December 2013 17:42 Go to next message
Scott Dybiec is currently offline Scott DybiecFriend
Messages: 148
Registered: July 2009
Senior Member
Occasionally some application coding change I make will introduce a
dangling reference in my model that shows up during an EMFStore local
save operation as an DanglingHREFException.

Since my testing doesn't find every case where a dangling reference
could be introduced, I'd like the application to be resilient to this
problem and still be able to save, but log the problem so I can fix it
later. An example stack trace is below.

Is it possible to customize the way EMFStore processes dangling
references? Here are the EMF options I'm familiar with:

String OPTION_PROCESS_DANGLING_HREF = "PROCESS_DANGLING_HREF";
String OPTION_PROCESS_DANGLING_HREF_THROW = "THROW";
String OPTION_PROCESS_DANGLING_HREF_DISCARD = "DISCARD";
String OPTION_PROCESS_DANGLING_HREF_RECORD = "RECORD";

Example stack trace:

!ENTRY org.eclipse.emf.emfstore.client 4 0 2013-12-10 11:36:45.716
!MESSAGE
file:/C:/projects/regatta-workbench/eclipse-4.3.1/eclipse/temp/emfstore-results-manager/profiles/default_dev/ps-_0fMuwGD7EeO-mNE_prK-yw/operations.eoc
The object
'com.humanfactor.rw.model.regatta.impl.SplitResultImpl@2893fe74
(bowNumber: 977, time: null, comments: null, status: eligible,
approvalStatus: candidate, captureStatus: expected)' is not contained in
a resource.
org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
'com.humanfactor.rw.model.regatta.impl.SplitResultImpl@2893fe74
(bowNumber: 977, time: null, comments: null, status: eligible,
approvalStatus: candidate, captureStatus: expected)' is not contained in
a resource.
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.handleDanglingHREF(XMLHelperImpl.java:754)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getHREF(XMLHelperImpl.java:788)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveEObjectSingle(XMLSaveImpl.java:1880)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1319)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1176)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1037)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2412)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1548)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1176)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1037)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2412)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1548)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:678)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:586)
at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:365)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
at
org.eclipse.emf.emfstore.internal.common.model.util.ModelUtil.saveResource(ModelUtil.java:427)
at
org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.saveDirtyResources(ResourcePersister.java:169)
at
org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.inspectChanges(ResourcePersister.java:313)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.notifiyObservers(ObserverBus.java:274)
at
org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.invoke(ObserverBus.java:260)
at com.sun.proxy.$Proxy16.inspectChanges(Unknown Source)
at
org.eclipse.emf.emfstore.internal.client.model.controller.UpdateController.doUpdate(UpdateController.java:147)
at
org.eclipse.emf.emfstore.internal.client.model.controller.UpdateController.run(UpdateController.java:93)
at
org.eclipse.emf.emfstore.internal.client.model.controller.UpdateController.run(UpdateController.java:1)
at
org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.run(ServerCall.java:249)
at
org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.executeCall(SessionManager.java:120)
at
org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.execute(SessionManager.java:61)
at
org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.execute(ServerCall.java:269)
at
org.eclipse.emf.emfstore.internal.client.model.impl.ProjectSpaceBase.update(ProjectSpaceBase.java:1263)
at
org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$12.call(ESLocalProjectImpl.java:475)
at
org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$12.call(ESLocalProjectImpl.java:1)
at
org.eclipse.emf.emfstore.client.util.RunESCommand$WithException$1.doRun(RunESCommand.java:60)
at
org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.commandBody(EMFStoreCommandWithResult.java:31)
at
org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.execute(AbstractEMFStoreCommand.java:64)
at
org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:78)
at
org.eclipse.emf.emfstore.internal.client.model.changeTracking.commands.EMFStoreBasicCommandStack.execute(EMFStoreBasicCommandStack.java:70)
at
org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.aRun(AbstractEMFStoreCommand.java:108)
at
org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.run(EMFStoreCommandWithResult.java:59)
at
org.eclipse.emf.emfstore.client.util.RunESCommand$WithException.runWithResult(RunESCommand.java:77)
at
org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl.update(ESLocalProjectImpl.java:472)
at
org.eclipse.emf.emfstore.internal.client.ui.controller.UIUpdateProjectController.doRun(UIUpdateProjectController.java:213)
at
org.eclipse.emf.emfstore.internal.client.ui.controller.UIUpdateProjectController.doRun(UIUpdateProjectController.java:1)
at
org.eclipse.emf.emfstore.internal.client.ui.common.MonitoredEMFStoreAction$1.run(MonitoredEMFStoreAction.java:70)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Re: [EMFStore] handling dangling references [message #1220517 is a reply to message #1220263] Thu, 12 December 2013 10:10 Go to previous message
Edgar Mueller is currently offline Edgar MuellerFriend
Messages: 89
Registered: March 2011
Member
Hi Scott,

yes, you are able to ignore DanglingHREFExceptions by using the
org.eclipse.emf.emfstore.common.discardDanglingHREFs extension point and
set its value to 'true'. If you ignore DanlingHREFs, EMFStore will log them.
Note that this extension point may be used for the client as well as for
the server.

Hope this helps.

Cheers,
Edgar

Am 10.12.2013 18:42, schrieb scott@xxxxxxxx:
> Occasionally some application coding change I make will introduce a
> dangling reference in my model that shows up during an EMFStore local
> save operation as an DanglingHREFException.
>
> Since my testing doesn't find every case where a dangling reference
> could be introduced, I'd like the application to be resilient to this
> problem and still be able to save, but log the problem so I can fix it
> later. An example stack trace is below.
>
> Is it possible to customize the way EMFStore processes dangling
> references? Here are the EMF options I'm familiar with:
>
> String OPTION_PROCESS_DANGLING_HREF = "PROCESS_DANGLING_HREF";
> String OPTION_PROCESS_DANGLING_HREF_THROW = "THROW";
> String OPTION_PROCESS_DANGLING_HREF_DISCARD = "DISCARD";
> String OPTION_PROCESS_DANGLING_HREF_RECORD = "RECORD";
>
> Example stack trace:
>
> !ENTRY org.eclipse.emf.emfstore.client 4 0 2013-12-10 11:36:45.716
> !MESSAGE
> file:/C:/projects/regatta-workbench/eclipse-4.3.1/eclipse/temp/emfstore-results-manager/profiles/default_dev/ps-_0fMuwGD7EeO-mNE_prK-yw/operations.eoc
>
> The object
> 'com.humanfactor.rw.model.regatta.impl.SplitResultImpl@2893fe74
> (bowNumber: 977, time: null, comments: null, status: eligible,
> approvalStatus: candidate, captureStatus: expected)' is not contained in
> a resource.
> org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
> 'com.humanfactor.rw.model.regatta.impl.SplitResultImpl@2893fe74
> (bowNumber: 977, time: null, comments: null, status: eligible,
> approvalStatus: candidate, captureStatus: expected)' is not contained in
> a resource.
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.handleDanglingHREF(XMLHelperImpl.java:754)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getHREF(XMLHelperImpl.java:788)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveEObjectSingle(XMLSaveImpl.java:1880)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1319)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1176)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1037)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2412)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1548)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1176)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1037)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2412)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1548)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:678)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:586)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:365)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
>
> at
> org.eclipse.emf.emfstore.internal.common.model.util.ModelUtil.saveResource(ModelUtil.java:427)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.saveDirtyResources(ResourcePersister.java:169)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.inspectChanges(ResourcePersister.java:313)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.notifiyObservers(ObserverBus.java:274)
>
> at
> org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.invoke(ObserverBus.java:260)
>
> at com.sun.proxy.$Proxy16.inspectChanges(Unknown Source)
> at
> org.eclipse.emf.emfstore.internal.client.model.controller.UpdateController.doUpdate(UpdateController.java:147)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.controller.UpdateController.run(UpdateController.java:93)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.controller.UpdateController.run(UpdateController.java:1)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.run(ServerCall.java:249)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.executeCall(SessionManager.java:120)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.execute(SessionManager.java:61)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.execute(ServerCall.java:269)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.ProjectSpaceBase.update(ProjectSpaceBase.java:1263)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$12.call(ESLocalProjectImpl.java:475)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$12.call(ESLocalProjectImpl.java:1)
>
> at
> org.eclipse.emf.emfstore.client.util.RunESCommand$WithException$1.doRun(RunESCommand.java:60)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.commandBody(EMFStoreCommandWithResult.java:31)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.execute(AbstractEMFStoreCommand.java:64)
>
> at
> org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:78)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.changeTracking.commands.EMFStoreBasicCommandStack.execute(EMFStoreBasicCommandStack.java:70)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.aRun(AbstractEMFStoreCommand.java:108)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.run(EMFStoreCommandWithResult.java:59)
>
> at
> org.eclipse.emf.emfstore.client.util.RunESCommand$WithException.runWithResult(RunESCommand.java:77)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl.update(ESLocalProjectImpl.java:472)
>
> at
> org.eclipse.emf.emfstore.internal.client.ui.controller.UIUpdateProjectController.doRun(UIUpdateProjectController.java:213)
>
> at
> org.eclipse.emf.emfstore.internal.client.ui.controller.UIUpdateProjectController.doRun(UIUpdateProjectController.java:1)
>
> at
> org.eclipse.emf.emfstore.internal.client.ui.common.MonitoredEMFStoreAction$1.run(MonitoredEMFStoreAction.java:70)
>
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
>


--
Edgar Mueller

Get Professional Eclipse Support: http://eclipsesource.com/munich
Previous Topic:EcoreUtil.getURI(feature)
Next Topic:[EMFStore] ESBrowser
Goto Forum:
  


Current Time: Mon Mar 08 06:45:20 GMT 2021

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

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

Back to the top