Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] migrate data from one repository to another
[CDO] migrate data from one repository to another [message #656138] Thu, 24 February 2011 10:56 Go to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 853
Registered: July 2009
Senior Member
I have a repository which has this structure:

- REPOSITORY ROOT
- libraries
- books
- authors

The "libraries" resource contains objects of type Library.
The Library has a reference feature to a Book. The Book has a reference feature to an Author.

Now, if I export the repository by resources, e.g. export /libraries into file libraries.xmi, the references to the books will look like:

<library:Library id="5CF8B1C1EE114423AB4788A63A68DD28" description="My Library">
<book href="cdo://1ff5d226-b1f0-40fb-aba2-0c31b38c764f/books#L16"/>
</library:Library>

If I want to import that xmi (using Import Roots in the CDO UI), I will get this error message:

The object "Book?(my.library.impl.BookImpl)" is not contained in a resource.

Now, each Book has an id feature. How can I instruct CDO to identify the object by that id feature instead of href="...".

Maybe, something like this:

<library:Library id="5CF8B1C1EE114423AB4788A63A68DD28" description="My Library">
<book id="my.books.MyUniqueBookId"/>
</library:Library>

Stack trace:

Caused by: org.eclipse.emf.cdo.util.DanglingReferenceException: The object "Book?(my.library.impl.BookImpl)" is not contained in a resource.

at org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDO ID(AbstractCDOView.java:913)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. provideCDOID(CDOTransactionImpl.java:1959)
at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ eValues(BaseCDORevision.java:649)
at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ e(BaseCDORevision.java:181)
at org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDORevision(CDODataOutputImpl.java:273)
at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requestingCommit(CommitTransactionRequest.java:151)
at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting(CommitTransactionRequest.java:112)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest WithMonitoring.requesting(CDOClientRequestWithMonitoring.jav a:92)
at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(Re questWithMonitoring.java:163)
at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedO utput(RequestWithConfirmation.java:117)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:286)
at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(R equestWithConfirmation.java:102)
at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(Req uestWithMonitoring.java:233)
at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.jav a:51)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:241)
at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalPr otocol.java:396)
at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(Requ estWithConfirmation.java:87)
at org.eclipse.net4j.signal.RequestWithConfirmation.send(Reques tWithConfirmation.java:73)
at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestW ithMonitoring.java:108)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtoco l.send(CDOClientProtocol.java:413)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtoco l.commitTransaction(CDOClientProtocol.java:295)
at org.eclipse.emf.internal.cdo.session.DelegatingSessionProtoc ol.commitTransaction(DelegatingSessionProtocol.java:262)
at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio nStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:8 0)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. commit(CDOTransactionImpl.java:1018)
... 3 more
Re: [CDO] migrate data from one repository to another [message #656157 is a reply to message #656138] Thu, 24 February 2011 11:17 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6446
Registered: July 2009
Senior Member
Hi Erdal,

Please see if http://www.eclipse.org/forums/index.php?t=tree&goto=6312 16&S=6616b8fc37341a82f9d1fc7aba9c9fef can help you.

BTW. in my other post I was suggesting a different export/import mechanism on the server side. That does not use the EMF xmi format.

Cheers
/Eike

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



Am 24.02.2011 11:56, schrieb Erdal Karaca:
> I have a repository which has this structure:
>
> - REPOSITORY ROOT
> - libraries
> - books
> - authors
>
> The "libraries" resource contains objects of type Library.
> The Library has a reference feature to a Book. The Book has a reference feature to an Author.
>
> Now, if I export the repository by resources, e.g. export /libraries into file libraries.xmi, the references to the books will look like:
>
> <library:Library id="5CF8B1C1EE114423AB4788A63A68DD28" description="My Library">
> <book href="cdo://1ff5d226-b1f0-40fb-aba2-0c31b38c764f/books#L16"/>
> </library:Library>
>
> If I want to import that xmi (using Import Roots in the CDO UI), I will get this error message:
>
> The object "Book?(my.library.impl.BookImpl)" is not contained in a resource.
>
> Now, each Book has an id feature. How can I instruct CDO to identify the object by that id feature instead of href="...".
>
> Maybe, something like this:
>
> <library:Library id="5CF8B1C1EE114423AB4788A63A68DD28" description="My Library">
> <book id="my.books.MyUniqueBookId"/>
> </library:Library>
>
> Stack trace:
>
> Caused by: org.eclipse.emf.cdo.util.DanglingReferenceException: The object "Book?(my.library.impl.BookImpl)" is not contained in a resource.
>
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDO ID(AbstractCDOView.java:913)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. provideCDOID(CDOTransactionImpl.java:1959)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ eValues(BaseCDORevision.java:649)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writ e(BaseCDORevision.java:181)
> at org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputIm pl.writeCDORevision(CDODataOutputImpl.java:273)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requestingCommit(CommitTransactionRequest.java:151)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactio nRequest.requesting(CommitTransactionRequest.java:112)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest WithMonitoring.requesting(CDOClientRequestWithMonitoring.jav a:92)
> at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(Re questWithMonitoring.java:163)
> at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedO utput(RequestWithConfirmation.java:117)
> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:286)
> at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(R equestWithConfirmation.java:102)
> at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(Req uestWithMonitoring.java:233)
> at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.jav a:51)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:241)
> at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalPr otocol.java:396)
> at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(Requ estWithConfirmation.java:87)
> at org.eclipse.net4j.signal.RequestWithConfirmation.send(Reques tWithConfirmation.java:73)
> at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestW ithMonitoring.java:108)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtoco l.send(CDOClientProtocol.java:413)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtoco l.commitTransaction(CDOClientProtocol.java:295)
> at org.eclipse.emf.internal.cdo.session.DelegatingSessionProtoc ol.commitTransaction(DelegatingSessionProtocol.java:262)
> at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio nStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:8 0)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. commit(CDOTransactionImpl.java:1018)
> ... 3 more


Previous Topic:[CDO] synchronize model changes with backend
Next Topic:query2 problem
Goto Forum:
  


Current Time: Sun Oct 20 17:07:12 GMT 2019

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

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

Back to the top