Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333076 - Support Ecore instances
Summary: Support Ecore instances
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: Power to the People
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-12-22 06:47 EST by Martin Fluegge CLA
Modified: 2011-06-23 03:41 EDT (History)
0 users

See Also:


Attachments
Patch v1 - for future reference (23.19 KB, patch)
2010-12-22 15:08 EST, Eike Stepper CLA
no flags Details | Diff
Patch v2 (1.14 KB, patch)
2010-12-24 04:56 EST, Martin Fluegge CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fluegge CLA 2010-12-22 06:47:42 EST
When saving a resource which contains elements from the ecore package (www.eclipse.org/emf/2002) an exception is thrown (see below). It seems as if there is problem mapping system packages to the DB.

org.eclipse.net4j.signal.RemoteException: org.eclipse.net4j.db.DBException: org.h2.jdbc.JdbcSQLException: Tabelle EPACKAGE nicht gefunden
Table EPACKAGE not found; SQL statement:
INSERT INTO EPackage(cdo_id, cdo_version, cdo_branch, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, name, nsURI, nsPrefix, eAnnotations, eClassifiers, eSubpackages) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [42102-117]
	at org.eclipse.emf.cdo.server.internal.db.SmartPreparedStatementCache.createCachedPreparedStatement(SmartPreparedStatementCache.java:84)
	at org.eclipse.emf.cdo.server.internal.db.SmartPreparedStatementCache.getPreparedStatement(SmartPreparedStatementCache.java:43)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.writeValues(HorizontalBranchingClassMapping.java:601)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.writeRevision(HorizontalBranchingClassMapping.java:803)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevision(DBStoreAccessor.java:563)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevisions(DBStoreAccessor.java:544)
	at org.eclipse.emf.cdo.spi.server.StoreAccessor.write(StoreAccessor.java:187)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:393)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:40)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
	at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:231)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:88)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
	at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
	at org.eclipse.net4j.signal.Signal.doInput(Signal.java:316)
	at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:241)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)
Caused by: org.h2.jdbc.JdbcSQLException: Tabelle EPACKAGE nicht gefunden
Table EPACKAGE not found; SQL statement:
INSERT INTO EPackage(cdo_id, cdo_version, cdo_branch, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, name, nsURI, nsPrefix, eAnnotations, eClassifiers, eSubpackages) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [42102-117]
	at org.h2.message.Message.getSQLException(Message.java:105)
	at org.h2.message.Message.getSQLException(Message.java:116)
	at org.h2.message.Message.getSQLException(Message.java:75)
	at org.h2.command.Parser.readTableOrView(Parser.java:4265)
	at org.h2.command.Parser.readTableOrView(Parser.java:4245)
	at org.h2.command.Parser.parseInsert(Parser.java:888)
	at org.h2.command.Parser.parsePrepared(Parser.java:368)
	at org.h2.command.Parser.parse(Parser.java:290)
	at org.h2.command.Parser.parse(Parser.java:262)
	at org.h2.command.Parser.prepareCommand(Parser.java:234)
	at org.h2.engine.Session.prepareLocal(Session.java:415)
	at org.h2.engine.Session.prepareCommand(Session.java:376)
	at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1049)
	at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:74)
	at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:233)
	at org.eclipse.emf.cdo.server.internal.db.SmartPreparedStatementCache.createCachedPreparedStatement(SmartPreparedStatementCache.java:79)
	... 23 more
Comment 1 Eike Stepper CLA 2010-12-22 15:08:46 EST
Created attachment 185733 [details]
Patch v1 - for future reference

I've introduced a new repository property "supportingEcore" that must be true during the first repository initialization for EcorePackage to be mapped.
Comment 2 Eike Stepper CLA 2010-12-22 15:09:48 EST
Committed to HEAD
Comment 3 Martin Fluegge CLA 2010-12-24 04:56:08 EST
Created attachment 185803 [details]
Patch v2

Thanks! Works nice ;)

But I think there was a small c&p error in patch v1. I fixed it in patch v2. Please commit if you agree that this was not intentional.
Comment 4 Eike Stepper CLA 2010-12-26 04:25:15 EST
Good catch. Please commit patch v2.
Comment 5 Martin Fluegge CLA 2010-12-26 04:38:19 EST
Patch v2 committed to HEAD.
Comment 6 Eike Stepper CLA 2011-06-23 03:41:26 EDT
Available in R20110608-1407