Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333648

Summary: querying the XRef and ensureReferentialIntegrity=true with abstract EMF classes
Product: [Modeling] EMF Reporter: Wim Bast <wim.bast>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED WORKSFORME QA Contact: Eike Stepper <stepper>
Severity: major    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Changes in the test models/tests - for future reference
none
Patch v2 none

Description Wim Bast CLA 2011-01-06 08:30:23 EST
Build Identifier: 

a query on the XRef without specific classes results in queries on tables of abstract classes. Tables of abstract classes do not exist, hence resulting in SQL exceptions. 

Reproducible: Always
Comment 1 Wim Bast CLA 2011-01-06 08:35:06 EST
org.eclipse.net4j.signal.RemoteException: org.eclipse.net4j.signal.RemoteException: org.eclipse.net4j.db.DBException: org.h2.jdbc.JdbcSQLException: Table PARTS_PART not found; SQL statement:
SELECT cdo_id, owningConcept FROM Parts_Part WHERE cdo_version>0 AND cdo_revised=0 AND owningConcept IN (20225) [42102-117]
   at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.queryScalarXRefs(AbstractHorizontalClassMapping.java:861)
   at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.queryXRefs(AbstractHorizontalClassMapping.java:785)
   at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy.queryXRefs(AbstractHorizontalMappingStrategy.java:139)
   at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.queryXRefs(DBStoreAccessor.java:289)
   at org.eclipse.emf.cdo.internal.server.XRefsQueryHandler.executeQuery(XRefsQueryHandler.java:63)
   at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:284)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)
Caused by: org.h2.jdbc.JdbcSQLException: Table PARTS_PART not found; SQL statement:
SELECT cdo_id, owningConcept FROM Parts_Part WHERE cdo_version>0 AND cdo_revised=0 AND owningConcept IN (20225) [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.readTableFilter(Parser.java:980)
......................
Comment 2 Eike Stepper CLA 2011-01-07 12:18:43 EST
I've spent hours trying to reproduce your problem, but failed. Can you give me the exact code that you use to call CDOView.queryXRefs()?

The only thing I could do is make an exception pop up a little earlier. Can you try that?
Comment 3 Eike Stepper CLA 2011-01-07 12:20:27 EST
Created attachment 186292 [details]
Changes in the test models/tests - for future reference
Comment 4 Eike Stepper CLA 2011-01-07 13:01:36 EST
Created attachment 186294 [details]
Patch v2
Comment 5 Eike Stepper CLA 2011-01-07 13:02:36 EST
Internal note: model1.Order is now abstract.
Comment 6 Eike Stepper CLA 2011-01-07 13:06:24 EST
Committed patch v2 to HEAD
Comment 7 Eike Stepper CLA 2011-01-25 06:54:30 EST
Wim, is this problem still present?
Comment 8 Wim Bast CLA 2011-01-25 06:59:43 EST
No, the problem seams to be fixed or was wrongly assigned to the 4.0 version. Probably the latter.
Comment 9 Eike Stepper CLA 2011-01-25 08:21:36 EST
Great! Please reopen if necessary ;-)