Home » Modeling » EMF » [CDO] Clearing a CDOResource content which has a Proxy object
| |
Re: [CDO] Clearing a CDOResource content which has a Proxy object [message #1059359 is a reply to message #1059281] |
Fri, 17 May 2013 16:11 |
|
Am 17.05.2013 12:46, schrieb Christophe Bouhier:
> Hi,
>
> I have a CDOResource, which has an object in it's content looking like this: (Copy paste from Variable View).
>
>
> eObject $Proxy23 (id=5790)
> 'eObject' referenced from:
> h org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1 (id=5792)
> 'h' referenced from:
> this$1 org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2 (id=333)
> val$source com.netxforge.netxstudio.scheduling.impl.JobRunContainerImpl (id=5795)
> val$target org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl (id=5796)
> val$type org.eclipse.emf.ecore.impl.EClassImpl (id=338)
>
>
> So apparently the referenced object was not resolved from the target. (JobRunContainer).
>
> How can I detect a stale reference? I have tried using
> CDOUtil.isStaleObject(..) but it's negative on the referenced object. (I can actually get the object with an exception).
What does CDOUtil.isStaleObject(..) return for that object (the one that you can get without an exception)? Can you
provide me with a small test case to reproduce it?
You can also compare with Bugzilla_279982_Test.testBugzilla_279982_Single().
>
> But when I clear the contents, I get an exception:
> I clean the list like this: (As you might notice, I call retainAll() which calls indexOf(..)
>
> I can get the same exception with contents.indexOf(Object).
>
>
>
> | QuartzScheduler_Worker-2 | 2013-05-17 12:39:08.575 | com.netxforge.netxstudio.server.job | /trace.jobs |
> com.netxforge.netxstudio.server.job.NetxForgeJob | execute | 127 | Error instantiating job: class
> com.netxforge.netxstudio.scheduling.impl.MetricSourceJobImpl | org.eclipse.emf.cdo.util.ObjectNotFoundException:
> Object OID21459772 not found
> at org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1.invoke(CDOStaleReferencePolicy.java:101)
> at $Proxy23.equals(Unknown Source)
Hm, we could let the proxy handle calls to equals() such that "arg0 == this", instead of throwing an
ObjectNotFoundException. Please submit an enhancement request.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
> at java.util.ArrayList.indexOf(ArrayList.java:269)
> at java.util.ArrayList.contains(ArrayList.java:252)
> at org.eclipse.emf.common.util.DelegatingEList.retainAll(DelegatingEList.java:579)
> at com.netxforge.netxstudio.server.job.NetxForgeJob.addAndTruncate(NetxForgeJob.java:236)
> at com.netxforge.netxstudio.server.job.NetxForgeJob.createWorkFlowMonitor(NetxForgeJob.java:146)
> at com.netxforge.netxstudio.server.job.NetxForgeJob.execute(NetxForgeJob.java:115)
> at org.quartz.core.JobRunShell.run(JobRunShell.java:206)
> at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)
>
>
> Thanks! Christophe
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Clearing a CDOResource content which has a Proxy object [message #1059771 is a reply to message #1059359] |
Tue, 21 May 2013 14:36 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
On 17-05-13 18:11, Eike Stepper wrote:
> Am 17.05.2013 12:46, schrieb Christophe Bouhier:
>> Hi,
>>
>> I have a CDOResource, which has an object in it's content looking like
>> this: (Copy paste from Variable View).
>>
>>
>> eObject $Proxy23 (id=5790)
>> 'eObject' referenced from:
>> h org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1 (id=5792)
>> 'h' referenced from:
>> this$1 org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2
>> (id=333)
>> val$source
>> com.netxforge.netxstudio.scheduling.impl.JobRunContainerImpl (id=5795)
>> val$target
>> org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl (id=5796)
>> val$type org.eclipse.emf.ecore.impl.EClassImpl (id=338)
>>
>>
>> So apparently the referenced object was not resolved from the target.
>> (JobRunContainer).
>>
>> How can I detect a stale reference? I have tried using
>> CDOUtil.isStaleObject(..) but it's negative on the referenced object.
>> (I can actually get the object with an exception).
> What does CDOUtil.isStaleObject(..) return for that object (the one that
> you can get without an exception)? Can you provide me with a small test
> case to reproduce it?
>
> You can also compare with
> Bugzilla_279982_Test.testBugzilla_279982_Single().
>
>>
Thanks Eike, will check this test case.
>> But when I clear the contents, I get an exception:
>> I clean the list like this: (As you might notice, I call retainAll()
>> which calls indexOf(..)
>>
>> I can get the same exception with contents.indexOf(Object).
>>
>>
>>
>> | QuartzScheduler_Worker-2 | 2013-05-17 12:39:08.575 |
>> com.netxforge.netxstudio.server.job | /trace.jobs |
>> com.netxforge.netxstudio.server.job.NetxForgeJob | execute | 127 |
>> Error instantiating job: class
>> com.netxforge.netxstudio.scheduling.impl.MetricSourceJobImpl |
>> org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID21459772
>> not found
>> at
>> org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1.invoke(CDOStaleReferencePolicy.java:101)
>>
>> at $Proxy23.equals(Unknown Source)
> Hm, we could let the proxy handle calls to equals() such that "arg0 ==
> this", instead of throwing an ObjectNotFoundException. Please submit an
> enhancement request.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
>> at java.util.ArrayList.indexOf(ArrayList.java:269)
>> at java.util.ArrayList.contains(ArrayList.java:252)
>> at
>> org.eclipse.emf.common.util.DelegatingEList.retainAll(DelegatingEList.java:579)
>>
>> at
>> com.netxforge.netxstudio.server.job.NetxForgeJob.addAndTruncate(NetxForgeJob.java:236)
>>
>> at
>> com.netxforge.netxstudio.server.job.NetxForgeJob.createWorkFlowMonitor(NetxForgeJob.java:146)
>>
>> at
>> com.netxforge.netxstudio.server.job.NetxForgeJob.execute(NetxForgeJob.java:115)
>>
>> at org.quartz.core.JobRunShell.run(JobRunShell.java:206)
>> at
>> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)
>>
>>
>>
>> Thanks! Christophe
>>
>
|
|
|
Re: [CDO] Clearing a CDOResource content which has a Proxy object [message #1060102 is a reply to message #1059771] |
Thu, 23 May 2013 06:54 |
Leila A Messages: 17 Registered: February 2013 |
Junior Member |
|
|
Dear Christophe,
Sorry for posting this question here.
I need to manage palette in papyrus programmatically when user is working on the diagram editor. When I select an element in the diagram editor, I need to refresh the palette. So I want to be able to add/remove some entries or set them as visible or invisible on the palette.
I found your reply to Dave posted in July 2009 about changing palette icons. You mentioned that its possible to access to paletteRoot through the editor: XXXDiagramEditor.getEditDomain().getpaletteViewer().getpaletteRoot()
Is the paletteRoot what I need for this case?
I traced the code and I guess the XXXDiagramEditor is UMLDiagramEditor. But the problem is that I don't know how to access to the UMLDiagramEditor:( can you please guide me?
Thanks and regards,
Leila
Christophe Bouhier wrote on Tue, 21 May 2013 10:36On 17-05-13 18:11, Eike Stepper wrote:
> Am 17.05.2013 12:46, schrieb Christophe Bouhier:
>> Hi,
>>
>> I have a CDOResource, which has an object in it's content looking like
>> this: (Copy paste from Variable View).
>>
>>
>> eObject $Proxy23 (id=5790)
>> 'eObject' referenced from:
>> h org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1 (id=5792)
>> 'h' referenced from:
>> this$1 org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2
>> (id=333)
>> val$source
>> com.netxforge.netxstudio.scheduling.impl.JobRunContainerImpl (id=5795)
>> val$target
>> org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl (id=5796)
>> val$type org.eclipse.emf.ecore.impl.EClassImpl (id=338)
>>
>>
>> So apparently the referenced object was not resolved from the target.
>> (JobRunContainer).
>>
>> How can I detect a stale reference? I have tried using
>> CDOUtil.isStaleObject(..) but it's negative on the referenced object.
>> (I can actually get the object with an exception).
> What does CDOUtil.isStaleObject(..) return for that object (the one that
> you can get without an exception)? Can you provide me with a small test
> case to reproduce it?
>
> You can also compare with
> Bugzilla_279982_Test.testBugzilla_279982_Single().
>
>>
Thanks Eike, will check this test case.
>> But when I clear the contents, I get an exception:
>> I clean the list like this: (As you might notice, I call retainAll()
>> which calls indexOf(..)
>>
>> I can get the same exception with contents.indexOf(Object).
>>
>>
>>
>> | QuartzScheduler_Worker-2 | 2013-05-17 12:39:08.575 |
>> com.netxforge.netxstudio.server.job | /trace.jobs |
>> com.netxforge.netxstudio.server.job.NetxForgeJob | execute | 127 |
>> Error instantiating job: class
>> com.netxforge.netxstudio.scheduling.impl.MetricSourceJobImpl |
>> org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID21459772
>> not found
>> at
>> org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1.invoke(CDOStaleReferencePolicy.java:101)
>>
>> at $Proxy23.equals(Unknown Source)
> Hm, we could let the proxy handle calls to equals() such that "arg0 ==
> this", instead of throwing an ObjectNotFoundException. Please submit an
> enhancement request.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
>> at java.util.ArrayList.indexOf(ArrayList.java:269)
>> at java.util.ArrayList.contains(ArrayList.java:252)
>> at
>> org.eclipse.emf.common.util.DelegatingEList.retainAll(DelegatingEList.java:579)
>>
>> at
>> com.netxforge.netxstudio.server.job.NetxForgeJob.addAndTruncate(NetxForgeJob.java:236)
>>
>> at
>> com.netxforge.netxstudio.server.job.NetxForgeJob.createWorkFlowMonitor(NetxForgeJob.java:146)
>>
>> at
>> com.netxforge.netxstudio.server.job.NetxForgeJob.execute(NetxForgeJob.java:115)
>>
>> at org.quartz.core.JobRunShell.run(JobRunShell.java:206)
>> at
>> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)
>>
>>
>>
>> Thanks! Christophe
>>
>
|
|
|
Re: [CDO] Clearing a CDOResource content which has a Proxy object [message #1060127 is a reply to message #1060102] |
Thu, 23 May 2013 08:27 |
|
Am 23.05.2013 08:54, schrieb Leila A:
> Dear Christophe,
>
> Sorry for posting this question here.
> I need to manage palette in papyrus programmatically when user is working on the diagram editor. When I select an
> element in the diagram editor, I need to refresh the palette. So I want to be able to add/remove some entries or set
> them as visible or invisible on the palette.
>
> I found your reply to Dave posted in July 2009 about changing palette icons. You mentioned that its possible to access
> to paletteRoot through the editor: XXXDiagramEditor.getEditDomain().getpaletteViewer().getpaletteRoot()
>
>
> Is the paletteRoot what I need for this case? I traced the code and I guess the XXXDiagramEditor is UMLDiagramEditor.
> But the problem is that I don't know how to access to the UMLDiagramEditor:( can you please guide me?
How's that related to CDO?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
> Thanks and regards,
> Leila
>
>
>
>
> Christophe Bouhier wrote on Tue, 21 May 2013 10:36
>> On 17-05-13 18:11, Eike Stepper wrote:
>> > Am 17.05.2013 12:46, schrieb Christophe Bouhier:
>> >> Hi,
>> >>
>> >> I have a CDOResource, which has an object in it's content looking like
>> >> this: (Copy paste from Variable View).
>> >>
>> >>
>> >> eObject $Proxy23 (id=5790)
>> >> 'eObject' referenced from:
>> >> h org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1 (id=5792)
>> >> 'h' referenced from:
>> >> this$1 org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2
>> >> (id=333)
>> >> val$source
>> >> com.netxforge.netxstudio.scheduling.impl.JobRunContainerImpl (id=5795)
>> >> val$target
>> >> org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl (id=5796)
>> >> val$type org.eclipse.emf.ecore.impl.EClassImpl (id=338)
>> >>
>> >>
>> >> So apparently the referenced object was not resolved from the target.
>> >> (JobRunContainer).
>> >>
>> >> How can I detect a stale reference? I have tried using
>> >> CDOUtil.isStaleObject(..) but it's negative on the referenced object.
>> >> (I can actually get the object with an exception).
>> > What does CDOUtil.isStaleObject(..) return for that object (the one that
>> > you can get without an exception)? Can you provide me with a small test
>> > case to reproduce it?
>> >
>> > You can also compare with
>> > Bugzilla_279982_Test.testBugzilla_279982_Single().
>> >
>> >>
>>
>> Thanks Eike, will check this test case.
>>
>> >> But when I clear the contents, I get an exception:
>> >> I clean the list like this: (As you might notice, I call retainAll()
>> >> which calls indexOf(..)
>> >>
>> >> I can get the same exception with contents.indexOf(Object).
>> >>
>> >>
>> >>
>> >> | QuartzScheduler_Worker-2 | 2013-05-17 12:39:08.575 |
>> >> com.netxforge.netxstudio.server.job | /trace.jobs |
>> >> com.netxforge.netxstudio.server.job.NetxForgeJob | execute | 127 |
>> >> Error instantiating job: class
>> >> com.netxforge.netxstudio.scheduling.impl.MetricSourceJobImpl |
>> >> org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID21459772
>> >> not found
>> >> at
>> >> org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1.invoke(CDOStaleReferencePolicy.java:101)
>> >>
>> >> at $Proxy23.equals(Unknown Source)
>> > Hm, we could let the proxy handle calls to equals() such that "arg0 ==
>> > this", instead of throwing an ObjectNotFoundException. Please submit an
>> > enhancement request.
>> >
>> > Cheers
>> > /Eike
>> >
>> > ----
>> > http://www.esc-net.de
>> > http://thegordian.blogspot.com
>> > http://twitter.com/eikestepper
>> >
>> >
>> >
>> >> at java.util.ArrayList.indexOf(ArrayList.java:269)
>> >> at java.util.ArrayList.contains(ArrayList.java:252)
>> >> at
>> >> org.eclipse.emf.common.util.DelegatingEList.retainAll(DelegatingEList.java:579)
>> >>
>> >> at
>> >> com.netxforge.netxstudio.server.job.NetxForgeJob.addAndTruncate(NetxForgeJob.java:236)
>> >>
>> >> at
>> >> com.netxforge.netxstudio.server.job.NetxForgeJob.createWorkFlowMonitor(NetxForgeJob.java:146)
>> >>
>> >> at
>> >> com.netxforge.netxstudio.server.job.NetxForgeJob.execute(NetxForgeJob.java:115)
>> >>
>> >> at org.quartz.core.JobRunShell.run(JobRunShell.java:206)
>> >> at
>> >> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)
>> >>
>> >>
>> >>
>> >> Thanks! Christophe
>> >>
>> >
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Clearing a CDOResource content which has a Proxy object [message #1060136 is a reply to message #1060102] |
Thu, 23 May 2013 09:28 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
On 23-05-13 08:54, Leila A wrote:
> Dear Christophe,
>
> Sorry for posting this question here.
I think it's better to mail them directly, if you need someone's
specific attention. Many people watching this forum will frown reading a
question about GMF/GEF here. Please mail me directly or on the GMF
forum, I will try to find the answer for you.
> I need to manage palette in papyrus programmatically when user is
> working on the diagram editor. When I select an element in the diagram
> editor, I need to refresh the palette. So I want to be able to
> add/remove some entries or set them as visible or invisible on the palette.
>
> I found your reply to Dave posted in July 2009 about changing palette
> icons. You mentioned that its possible to access to paletteRoot through
> the editor:
> XXXDiagramEditor.getEditDomain().getpaletteViewer().getpaletteRoot()
>
>
> Is the paletteRoot what I need for this case? I traced the code and I
> guess the XXXDiagramEditor is UMLDiagramEditor. But the problem is that
> I don't know how to access to the UMLDiagramEditor:( can you please
> guide me?
> Thanks and regards,
> Leila
>
>
>
>
> Christophe Bouhier wrote on Tue, 21 May 2013 10:36
>> On 17-05-13 18:11, Eike Stepper wrote:
>> > Am 17.05.2013 12:46, schrieb Christophe Bouhier:
>> >> Hi,
>> >>
>> >> I have a CDOResource, which has an object in it's content looking like
>> >> this: (Copy paste from Variable View).
>> >>
>> >>
>> >> eObject $Proxy23 (id=5790)
>> >> 'eObject' referenced from:
>> >> h org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1
>> (id=5792)
>> >> 'h' referenced from:
>> >> this$1 org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2
>> >> (id=333)
>> >> val$source
>> >> com.netxforge.netxstudio.scheduling.impl.JobRunContainerImpl (id=5795)
>> >> val$target
>> >> org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl (id=5796)
>> >> val$type org.eclipse.emf.ecore.impl.EClassImpl (id=338)
>> >>
>> >>
>> >> So apparently the referenced object was not resolved from the target.
>> >> (JobRunContainer).
>> >>
>> >> How can I detect a stale reference? I have tried using
>> >> CDOUtil.isStaleObject(..) but it's negative on the referenced object.
>> >> (I can actually get the object with an exception).
>> > What does CDOUtil.isStaleObject(..) return for that object (the one
>> that
>> > you can get without an exception)? Can you provide me with a small test
>> > case to reproduce it?
>> >
>> > You can also compare with
>> > Bugzilla_279982_Test.testBugzilla_279982_Single().
>> >
>> >>
>>
>> Thanks Eike, will check this test case.
>>
>> >> But when I clear the contents, I get an exception:
>> >> I clean the list like this: (As you might notice, I call retainAll()
>> >> which calls indexOf(..)
>> >>
>> >> I can get the same exception with contents.indexOf(Object).
>> >>
>> >>
>> >>
>> >> | QuartzScheduler_Worker-2 | 2013-05-17 12:39:08.575 |
>> >> com.netxforge.netxstudio.server.job | /trace.jobs |
>> >> com.netxforge.netxstudio.server.job.NetxForgeJob | execute | 127 |
>> >> Error instantiating job: class
>> >> com.netxforge.netxstudio.scheduling.impl.MetricSourceJobImpl |
>> >> org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID21459772
>> >> not found
>> >> at
>> >>
>> org.eclipse.emf.cdo.view.CDOStaleReferencePolicy$2$1.invoke(CDOStaleReferencePolicy.java:101)
>>
>> >>
>> >> at $Proxy23.equals(Unknown Source)
>> > Hm, we could let the proxy handle calls to equals() such that "arg0 ==
>> > this", instead of throwing an ObjectNotFoundException. Please submit an
>> > enhancement request.
>> >
>> > Cheers
>> > /Eike
>> >
>> > ----
>> > http://www.esc-net.de
>> > http://thegordian.blogspot.com
>> > http://twitter.com/eikestepper
>> >
>> >
>> >
>> >> at java.util.ArrayList.indexOf(ArrayList.java:269)
>> >> at java.util.ArrayList.contains(ArrayList.java:252)
>> >> at
>> >>
>> org.eclipse.emf.common.util.DelegatingEList.retainAll(DelegatingEList.java:579)
>>
>> >>
>> >> at
>> >>
>> com.netxforge.netxstudio.server.job.NetxForgeJob.addAndTruncate(NetxForgeJob.java:236)
>>
>> >>
>> >> at
>> >>
>> com.netxforge.netxstudio.server.job.NetxForgeJob.createWorkFlowMonitor(NetxForgeJob.java:146)
>>
>> >>
>> >> at
>> >>
>> com.netxforge.netxstudio.server.job.NetxForgeJob.execute(NetxForgeJob.java:115)
>>
>> >>
>> >> at org.quartz.core.JobRunShell.run(JobRunShell.java:206)
>> >> at
>> >>
>> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)
>>
>> >>
>> >>
>> >>
>> >> Thanks! Christophe
>> >>
>> >
>
|
|
|
Goto Forum:
Current Time: Tue Sep 24 01:09:52 GMT 2024
Powered by FUDForum. Page generated in 0.04009 seconds
|