Issue Details (XML | Word | Printable)

Key: JDO-93
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Erik Bengtson
Reporter: Michael Bouschen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

CompletenessTest fails when navigating a self-referencing relationship

Created: 15/Jul/05 10:46 PM   Updated: 23/Apr/06 02:45 AM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: JDO 2 beta

Time Tracking:
Not Specified

Resolution Date: 23/Apr/06 02:45 AM


 Description  « Hide
Running the CompletenessTest results in a JDODataStoreException with a nested exception complaining about the generated SQL:
ERROR 42X03: Column name 'APPLICATIONIDENTITY0.PERSONS.PERSONID' is in more than one table in the FROM list.

The test traverses a graph of persistent objects and calls getProtege on a FullTimeEmployee instance. This navigates the protege<->mentor relationship specified in the superclass Employee. Please note, protege<->mentor is a self referencing relationship from Employee to Employee.

The error message reads as if the generated SQL misses to specify a table alias for the table in the JOIN clause.

I use the following configuration stored in test/conf/onetest.conf:
jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships.
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org.apache.jdo.tck.pc.company.companyNoRelationships.xml
jdo.tck.standarddata =
jdo.tck.mapping = 0

This is the maven call:
maven -o -Djdo.tck.cfglist=onetest.conf -Djdo.tck.identitytypes=applicationidentity runtck.jdori

Here is the stacktrace:
test(org.apache.jdo.tck.mapping.CompletenessTest)javax.jdo.JDODataStoreException: Fetch request failed: SELECT applicationidentity0.PERSONS.PERSONID FROM applicationidentity0.PERSONS LEFT OUTER JOIN applicationidentity0.PERSONS ON applicationidentity0.PERSONS.PERSONID = applicationidentity0.PERSONS.MENTOR WHERE (applicationidentity0.PERSONS.PERSONID = ?)
        at org.jpox.store.rdbms.request.FetchRequest.execute(FetchRequest.java:196)
        at org.jpox.store.rdbms.table.ClassTable.fetch(ClassTable.java:1771)
        at org.jpox.store.StoreManager.fetch(StoreManager.java:684)
        at org.jpox.state.StateManagerImpl.loadNonDFGFields(StateManagerImpl.java:1612)
        at org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.java:1733)
        at org.apache.jdo.tck.pc.company.Employee.jdoGetprotege(Employee.java)
        at org.apache.jdo.tck.pc.company.Employee.deepCompareFields(Employee.java:455)
        at org.apache.jdo.tck.pc.company.FullTimeEmployee.deepCompareFields(FullTimeEmployee.java:119)
        at org.apache.jdo.tck.mapping.CompletenessTest.test(CompletenessTest.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)
NestedThrowablesStackTrace:
ERROR 42X03: Column name 'APPLICATIONIDENTITY0.PERSONS.PERSONID' is in more than one table in the FROM list.
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java)
        at org.apache.derby.impl.sql.compile.JoinNode.getMatchingColumn(JoinNode.java)
        at org.apache.derby.impl.sql.compile.FromList.bindColumnReference(FromList.java)
        at org.apache.derby.impl.sql.compile.ColumnReference.bindExpression(ColumnReference.java)
        at org.apache.derby.impl.sql.compile.ResultColumn.bindExpression(ResultColumn.java)
        at org.apache.derby.impl.sql.compile.ResultColumnList.bindExpressions(ResultColumnList.java)
        at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java)
        at org.apache.derby.impl.sql.compile.ReadCursorNode.bind(ReadCursorNode.java)
        at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java)
        at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java)
        at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Driver30.java)
        at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java)
        at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java)
        at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:303)
        at org.jpox.store.rdbms.request.FetchRequest.execute(FetchRequest.java:140)
        at org.jpox.store.rdbms.table.ClassTable.fetch(ClassTable.java:1771)
        at org.jpox.store.StoreManager.fetch(StoreManager.java:684)
        at org.jpox.state.StateManagerImpl.loadNonDFGFields(StateManagerImpl.java:1612)
        at org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.java:1733)
        at org.apache.jdo.tck.pc.company.Employee.jdoGetprotege(Employee.java)
        at org.apache.jdo.tck.pc.company.Employee.deepCompareFields(Employee.java:455)
        at org.apache.jdo.tck.pc.company.FullTimeEmployee.deepCompareFields(FullTimeEmployee.java:119)
        at org.apache.jdo.tck.mapping.CompletenessTest.test(CompletenessTest.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michael Bouschen made changes - 15/Jul/05 10:48 PM
Field Original Value New Value
Description Running the CompletenessTest results in a JDODataStoreException with a nested exception complaining about the generetd SQL:
ERROR 42X03: Column name 'APPLICATIONIDENTITY0.PERSONS.PERSONID' is in more than one table in the FROM list.

The test traverses a graph of persistent objects and calls getProtege on a FullTimeEmployee instance. This navigates the protege<->mentor relationship specified in the superclass Employee. Please note, protege<->mentor is a self referencing relationship from Employee to Employee.
The error message reads as if the generated SQL misses to specify a table alias for the table in the JOIN clause.

I use the following configuration stored in test/conf/onetest.conf:
jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships.
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org.apache.jdo.tck.pc.company.companyNoRelationships.xml
jdo.tck.standarddata =
jdo.tck.mapping = 0

This is the maven call:
maven -o -Djdo.tck.cfglist=onetest.conf -Djdo.tck.identitytypes=applicationidentity runtck.jdori

Here is the stacktrace:
test(org.apache.jdo.tck.mapping.CompletenessTest)javax.jdo.JDODataStoreException: Fetch request failed: SELECT applicationidentity0.PERSONS.PERSONID FROM applicationidentity0.PERSONS LEFT OUTER JOIN applicationidentity0.PERSONS ON applicationidentity0.PERSONS.PERSONID = applicationidentity0.PERSONS.MENTOR WHERE (applicationidentity0.PERSONS.PERSONID = ?)
        at org.jpox.store.rdbms.request.FetchRequest.execute(FetchRequest.java:196)
        at org.jpox.store.rdbms.table.ClassTable.fetch(ClassTable.java:1771)
        at org.jpox.store.StoreManager.fetch(StoreManager.java:684)
        at org.jpox.state.StateManagerImpl.loadNonDFGFields(StateManagerImpl.java:1612)
        at org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.java:1733)
        at org.apache.jdo.tck.pc.company.Employee.jdoGetprotege(Employee.java)
        at org.apache.jdo.tck.pc.company.Employee.deepCompareFields(Employee.java:455)
        at org.apache.jdo.tck.pc.company.FullTimeEmployee.deepCompareFields(FullTimeEmployee.java:119)
        at org.apache.jdo.tck.mapping.CompletenessTest.test(CompletenessTest.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)
NestedThrowablesStackTrace:
ERROR 42X03: Column name 'APPLICATIONIDENTITY0.PERSONS.PERSONID' is in more than one table in the FROM list.
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java)
        at org.apache.derby.impl.sql.compile.JoinNode.getMatchingColumn(JoinNode.java)
        at org.apache.derby.impl.sql.compile.FromList.bindColumnReference(FromList.java)
        at org.apache.derby.impl.sql.compile.ColumnReference.bindExpression(ColumnReference.java)
        at org.apache.derby.impl.sql.compile.ResultColumn.bindExpression(ResultColumn.java)
        at org.apache.derby.impl.sql.compile.ResultColumnList.bindExpressions(ResultColumnList.java)
        at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java)
        at org.apache.derby.impl.sql.compile.ReadCursorNode.bind(ReadCursorNode.java)
        at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java)
        at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java)
        at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Driver30.java)
        at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java)
        at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java)
        at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:303)
        at org.jpox.store.rdbms.request.FetchRequest.execute(FetchRequest.java:140)
        at org.jpox.store.rdbms.table.ClassTable.fetch(ClassTable.java:1771)
        at org.jpox.store.StoreManager.fetch(StoreManager.java:684)
        at org.jpox.state.StateManagerImpl.loadNonDFGFields(StateManagerImpl.java:1612)
        at org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.java:1733)
        at org.apache.jdo.tck.pc.company.Employee.jdoGetprotege(Employee.java)
        at org.apache.jdo.tck.pc.company.Employee.deepCompareFields(Employee.java:455)
        at org.apache.jdo.tck.pc.company.FullTimeEmployee.deepCompareFields(FullTimeEmployee.java:119)
        at org.apache.jdo.tck.mapping.CompletenessTest.test(CompletenessTest.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)
Running the CompletenessTest results in a JDODataStoreException with a nested exception complaining about the generated SQL:
ERROR 42X03: Column name 'APPLICATIONIDENTITY0.PERSONS.PERSONID' is in more than one table in the FROM list.

The test traverses a graph of persistent objects and calls getProtege on a FullTimeEmployee instance. This navigates the protege<->mentor relationship specified in the superclass Employee. Please note, protege<->mentor is a self referencing relationship from Employee to Employee.

The error message reads as if the generated SQL misses to specify a table alias for the table in the JOIN clause.

I use the following configuration stored in test/conf/onetest.conf:
jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships.
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org.apache.jdo.tck.pc.company.companyNoRelationships.xml
jdo.tck.standarddata =
jdo.tck.mapping = 0

This is the maven call:
maven -o -Djdo.tck.cfglist=onetest.conf -Djdo.tck.identitytypes=applicationidentity runtck.jdori

Here is the stacktrace:
test(org.apache.jdo.tck.mapping.CompletenessTest)javax.jdo.JDODataStoreException: Fetch request failed: SELECT applicationidentity0.PERSONS.PERSONID FROM applicationidentity0.PERSONS LEFT OUTER JOIN applicationidentity0.PERSONS ON applicationidentity0.PERSONS.PERSONID = applicationidentity0.PERSONS.MENTOR WHERE (applicationidentity0.PERSONS.PERSONID = ?)
        at org.jpox.store.rdbms.request.FetchRequest.execute(FetchRequest.java:196)
        at org.jpox.store.rdbms.table.ClassTable.fetch(ClassTable.java:1771)
        at org.jpox.store.StoreManager.fetch(StoreManager.java:684)
        at org.jpox.state.StateManagerImpl.loadNonDFGFields(StateManagerImpl.java:1612)
        at org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.java:1733)
        at org.apache.jdo.tck.pc.company.Employee.jdoGetprotege(Employee.java)
        at org.apache.jdo.tck.pc.company.Employee.deepCompareFields(Employee.java:455)
        at org.apache.jdo.tck.pc.company.FullTimeEmployee.deepCompareFields(FullTimeEmployee.java:119)
        at org.apache.jdo.tck.mapping.CompletenessTest.test(CompletenessTest.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)
NestedThrowablesStackTrace:
ERROR 42X03: Column name 'APPLICATIONIDENTITY0.PERSONS.PERSONID' is in more than one table in the FROM list.
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java)
        at org.apache.derby.impl.sql.compile.JoinNode.getMatchingColumn(JoinNode.java)
        at org.apache.derby.impl.sql.compile.FromList.bindColumnReference(FromList.java)
        at org.apache.derby.impl.sql.compile.ColumnReference.bindExpression(ColumnReference.java)
        at org.apache.derby.impl.sql.compile.ResultColumn.bindExpression(ResultColumn.java)
        at org.apache.derby.impl.sql.compile.ResultColumnList.bindExpressions(ResultColumnList.java)
        at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java)
        at org.apache.derby.impl.sql.compile.ReadCursorNode.bind(ReadCursorNode.java)
        at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java)
        at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java)
        at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Driver30.java)
        at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java)
        at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java)
        at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:303)
        at org.jpox.store.rdbms.request.FetchRequest.execute(FetchRequest.java:140)
        at org.jpox.store.rdbms.table.ClassTable.fetch(ClassTable.java:1771)
        at org.jpox.store.StoreManager.fetch(StoreManager.java:684)
        at org.jpox.state.StateManagerImpl.loadNonDFGFields(StateManagerImpl.java:1612)
        at org.jpox.state.StateManagerImpl.isLoaded(StateManagerImpl.java:1733)
        at org.apache.jdo.tck.pc.company.Employee.jdoGetprotege(Employee.java)
        at org.apache.jdo.tck.pc.company.Employee.deepCompareFields(Employee.java:455)
        at org.apache.jdo.tck.pc.company.FullTimeEmployee.deepCompareFields(FullTimeEmployee.java:119)
        at org.apache.jdo.tck.mapping.CompletenessTest.test(CompletenessTest.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:203)
        at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
        at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)
Michael Bouschen made changes - 16/Jul/05 01:28 AM
Assignee Erik Bengtson [ ebengtso ]
Andy Jefferson added a comment - 10/Aug/05 04:54 AM
I have a fix for JPOX for this, but currently SourceForge CVS is down (for up to 36 hours). I'll check it in when they allow us access ;-)

Michael Bouschen added a comment - 11/Aug/05 09:29 PM
The issue is fixed with the JPOX nightly build from 11-Aug-2005.

Michael Bouschen made changes - 11/Aug/05 09:32 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Michael Bouschen made changes - 11/Aug/05 09:38 PM
Status Resolved [ 5 ] Closed [ 6 ]
Michael Bouschen added a comment - 23/Apr/06 02:43 AM
Reopened to set the Fix Version/s field to JDO 2 beta.

Michael Bouschen made changes - 23/Apr/06 02:43 AM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Michael Bouschen made changes - 23/Apr/06 02:45 AM
Fix Version/s JDO 2 beta [ 12310683 ]
Status Reopened [ 4 ] Closed [ 6 ]
Resolution Fixed [ 1 ]