Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Cross resources references
[CDO] Cross resources references [message #649405] Wed, 19 January 2011 07:23 Go to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I have created two resource sets using the CDO UI.
Each of the resource set contains different objects.

The objects do reference other objects contained in different resource sets.
Now, If I export resource set 1 to an xmi file, delete that resource set, recreate it and import the roots from the xmi file and commit, CDO will complain about an object not being contained in any resource set.
If I reselect the feature (which is a cross reference) of the object before comitting, CDO will not complain.
Re: [CDO] Cross resources references [message #649419 is a reply to message #649405] Wed, 19 January 2011 08:12 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 19.01.2011 08:23, schrieb Erdal Karaca:
> I have created two resource sets using the CDO UI.
How do you know that? Have you used different transactions? Normally all open editors share the same resource set of their transaction.

> Each of the resource set contains different objects.
Why do you need different resource sets? *EMF* does not support proxy resolution between multiple resource sets. A resource set is the scope for proxy resolution.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> The objects do reference other objects contained in different resource sets.
> Now, If I export resource set 1 to an xmi file, delete that resource set, recreate it and import the roots from the xmi file and commit, CDO will complain about an object not being contained in any resource set.
> If I reselect the feature (which is a cross reference) of the object before comitting, CDO will not complain.
>


Re: [CDO] Cross resources references [message #649422 is a reply to message #649419] Wed, 19 January 2011 08:30 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I see. Then, you have to replace "resource set" with "resource".
I assumed one CDO resource = one EMF resource set?

So, what is the problem here? Why does CDO complain about an object that is not contained in any resource?

Error message:
The object "ClassName?(com.example.mypacke.ClassNameImpl)" is not contained in a resource

If I re-select the instance of that class in the UI, the commit succeeds.
Re: [CDO] Cross resources references [message #649430 is a reply to message #649422] Wed, 19 January 2011 08:41 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 19.01.2011 09:30, schrieb Erdal Karaca:
> I see. Then, you have to replace "resource set" with "resource".
> I assumed one CDO resource = one EMF resource set?
>
> So, what is the problem here? Why does CDO complain about an object that is not contained in any resource?
Do you have a stack trace?

>
> Error message:
> The object "ClassName?(com.example.mypacke.ClassNameImpl)" is not contained in a resource
>
> If I re-select the instance of that class in the UI, the commit succeeds.
What do you mean by "re-select"?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Cross resources references [message #650328 is a reply to message #649430] Mon, 24 January 2011 12:23 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
This is the stack trace:

org.eclipse.emf.cdo.util.DanglingReferenceException: The object "MyObject?(my.package.MyObjectImpl)" is not contained in a resource
	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDOID(AbstractCDOView.java:913)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.provideCDOID(CDOTransactionImpl.java:1959)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writeValues(BaseCDORevision.java:649)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.write(BaseCDORevision.java:181)
	at org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputImpl.writeCDORevision(CDODataOutputImpl.java:273)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requestingCommit(CommitTransactionRequest.java:151)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:112)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequestWithMonitoring.requesting(CDOClientRequestWithMonitoring.java:92)
	at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(RequestWithMonitoring.java:163)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedOutput(RequestWithConfirmation.java:117)
	at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:286)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:102)
	at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(RequestWithMonitoring.java:233)
	at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:51)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:241)
	at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:396)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:87)
	at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:73)
	at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestWithMonitoring.java:108)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:413)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.commitTransaction(CDOClientProtocol.java:295)
	at org.eclipse.emf.internal.cdo.session.DelegatingSessionProtocol.commitTransaction(DelegatingSessionProtocol.java:262)
	at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:80)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1018)
	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:914)
	at org.eclipse.emf.cdo.internal.ui.editor.CDOEditor$19.run(CDOEditor.java:1774)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)


By "re-select" I mean: I have to unselect the feature 'MyObject', then, select it again in the CDO UI.

Eike Stepper wrote on Wed, 19 January 2011 03:41
Am 19.01.2011 09:30, schrieb Erdal Karaca:
> I see. Then, you have to replace "resource set" with "resource".
> I assumed one CDO resource = one EMF resource set?
>
> So, what is the problem here? Why does CDO complain about an object that is not contained in any resource?
Do you have a stack trace?

>
> Error message:
> The object "ClassName?(com.example.mypacke.ClassNameImpl)" is not contained in a resource
>
> If I re-select the instance of that class in the UI, the commit succeeds.
What do you mean by "re-select"?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper

Re: [CDO] Cross resources references [message #650339 is a reply to message #650328] Mon, 24 January 2011 12:56 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
The problem is: If I want to serialize the whole repository to xmi files. I am using multiple resources to separate the objects. If I export each resource as a single xmi, then, import into a new repository (maybe on a different machine), then the references will not be resolved...
Re: [CDO] Cross resources references [message #650346 is a reply to message #650339] Mon, 24 January 2011 14:05 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I just tried to put everything into one resource on the repository and it works.
So, does that mean, objects contained in one resource cannot reference objects contained in another resource?

I want to provide a "clean" structure in the repository, i.e. separate objects by their business meaning.
Re: [CDO] Cross resources references [message #650374 is a reply to message #650346] Mon, 24 January 2011 16:39 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 24.01.2011 15:05, schrieb Erdal Karaca:
> I just tried to put everything into one resource on the repository and it works.
> So, does that mean, objects contained in one resource cannot reference objects contained in another resource?
That's perfectly possible. You must have done something wrong, but I had no time yet to dig into this.


> I want to provide a "clean" structure in the repository, i.e. separate objects by their business meaning.
Note that moving objects within a CDO repo is way easier and quicker than within a file system because the CDO objects point to each other through immutable object IDs.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:[CDO] enumerate (ocl) query parameter names
Next Topic:Nested xsd:any loading issues
Goto Forum:
  


Current Time: Thu Apr 25 16:41:11 GMT 2024

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

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

Back to the top