|
Re: CDOServerImporter throws Unique index or primary key violation [message #1031007 is a reply to message #1022886] |
Mon, 01 April 2013 03:56 |
|
Hi Andrew,
Sorry for the late reply, I've just returned from the EclipseCon in Boston.
Is it possible that you provide me with a test case similar to the ones in org.eclipse.emf.cdo.tests.BackupTest?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 22.03.2013 19:11, schrieb Andrew Whelan:
> Hello,
> I am trying to use CDOServerExport.XML to export data from an H2 repository to an XML file and then import it (using CDOServerImport.XML) to a repository of a different name. When I run the import (to import the file that was exported) a "Unique index or primary key violation" exception is thrown. It is shown at the bottom of this message.
>
> I have attached one file of Java code and the CDO Server configuration file.
> I am using the org.eclipse.emf.cdo.server.product.tcp_h2 product as a server. I am using the Company example plugin.
>
> I run 4 methods from the main() method of the code. I comment out what I am not running at a particular time. Directions are as follows.
>
> 1)Start up the CDO server using a Run Configuration as described in the following tutorial: http://www.rcp-vision.com/?p=1285&lang=en
>
> 2)Uncomment the populate() and get() methods in the main(). This will populate the database with a few records and print the names of the companies and customers. Run the application.
>
> 3)Shut down the CDO Server.
>
> 4)Comment out the populate() and get() methods in the main(). Uncomment the Export() method in the main (I have a hard coded path for the export file). Run the application.
>
> 5)Delete the H2 database top level directory. (this step should be optional as I am
> using a different repository name for the import).
>
> 6)Comment out the Export() method in the main(). Uncomment the Import() method in the main(). When I run the application I get the following exception.
> Any ideas? Is it a bug? Thanks!
>
> org.eclipse.net4j.db.DBException: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "I1363973975334_3 ON PUBLIC.CDO_PACKAGE_UNITS(ID)"; SQL statement:
> INSERT INTO cdo_package_units VALUES (?, ?, ?, ?) [23505-168]
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:262)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:291)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.writePackageUnits(MetaDataManager.java:138)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:826)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.rawStore(DBStoreAccessor.java:1240)
> at org.eclipse.emf.cdo.server.CDOServerImporter$FlushHandler.handleModels(CDOServerImporter.java:240)
> at org.eclipse.emf.cdo.server.CDOServerImporter$XML$XMLHandler.endElement(CDOServerImporter.java:548)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2939)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
> at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
> at org.eclipse.emf.cdo.server.CDOServerImporter$XML.importAll(CDOServerImporter.java:329)
> at org.eclipse.emf.cdo.server.CDOServerImporter.importRepository(CDOServerImporter.java:111)
> at org.eclipse.example.library.tests.TestCDOH2.Import(TestCDOH2.java:203)
> at org.eclipse.example.library.tests.TestCDOH2.main(TestCDOH2.java:246)
> Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "I1363973975334_3 ON PUBLIC.CDO_PACKAGE_UNITS(ID)"; SQL statement:
> INSERT INTO cdo_package_units VALUES (?, ?, ?, ?) [23505-168]
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
> at org.h2.message.DbException.get(DbException.java:169)
> at org.h2.message.DbException.get(DbException.java:146)
> at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:81)
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: CDOServerImporter throws Unique index or primary key violation [message #1034379 is a reply to message #1032946] |
Fri, 05 April 2013 11:13 |
|
Am 03.04.2013 19:04, schrieb Andrew Whelan:
> Hi Eike,
> After looking the org.eclipse.emf.cdo.tests.BackupTest, it appears that this stuff is only being tested using
> MEMStore? I doesn't appear that BackupTest is testing using DBStore. Does this sound like it could be correct?
No, compare
https://hudson.eclipse.org/hudson/job/emf-cdo-integration/lastCompletedBuild/testReport/org.eclipse.emf.cdo.tests.db.AllTestsDBH2All$Scenario%5BCombined,%20H2-branching,%20JVM,%20Native%5D$org.eclipse.emf.cdo.tests/BackupTest
You can't tell by just looking at the test case. You need to run one of our test suites that configure specifc scenarios
for all tests, e.g., "CDO AllTests (H2 branching)".
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.03552 seconds