You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Michael Bouschen (JIRA)" <ji...@apache.org> on 2005/12/19 21:30:32 UTC

[jira] Updated: (JDO-241) JPOX returns wrong query result for non-extent queries.

     [ http://issues.apache.org/jira/browse/JDO-241?page=all ]

Michael Bouschen updated JDO-241:
---------------------------------

    Attachment: JDO-241.patch

Attached you find a patch for review.

As Andy pointed out, support for queries over transient instances is optional. The patch changes the memory collection used as query candidates to include persistent instances. The test case still does not succeed, because JPOX seems to eliminate duplicates for a memory collection query with result specified as "this".

> JPOX returns wrong query result for non-extent queries.
> -------------------------------------------------------
>
>          Key: JDO-241
>          URL: http://issues.apache.org/jira/browse/JDO-241
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Reporter: Michael Watzek
>     Assignee: Erik Bengtson
>  Attachments: JDO-241.patch
>
> Test case DistinctCandidateInstances fails because JPOX returns an empty collection for the query below. The query uses a candidate collection.
> 14:22:46,781 (main) DEBUG [org.apache.jdo.tck] - Executing JDO query: SELECT FROM org.apache.jdo.tck.pc.company.Person
> 14:22:46,796 (main) DEBUG [org.apache.jdo.tck] - Query result: []
> 14:22:46,812 (main) DEBUG [org.apache.jdo.tck] - Wrong query result: 
> expected: [FullTimeEmployee(1, emp1Last, emp1First, born 10/Jun/1970, phone {work=123456-1, home=1111}, hired 1/Jan/1999, weeklyhours 40.0, $20000.0), FullTimeEmployee(2, emp2Last, emp2First, born 22/Dec/1975, phone {work=123456-2, home=2222}, hired 1/Jul/2003, weeklyhours 40.0, $10000.0), PartTimeEmployee(3, emp3Last, emp3First, born 5/Sep/1972, phone {work=123456-3, home=3333}, hired 15/Aug/2002, weeklyhours 19.0, $15000.0), PartTimeEmployee(4, emp4Last, emp4First, born 6/Sep/1973, phone {work=124456-3, home=3343}, hired 15/Apr/2001, weeklyhours 0.0, $13000.0), FullTimeEmployee(5, emp5Last, emp5First, born 5/Jul/1962, phone {work=126456-3, home=3363}, hired 15/Aug/1998, weeklyhours 0.0, $45000.0), FullTimeEmployee(1, emp1Last, emp1First, born 10/Jun/1970, phone {work=123456-1, home=1111}, hired 1/Jan/1999, weeklyhours 40.0, $20000.0), FullTimeEmployee(2, emp2Last, emp2First, born 22/Dec/1975, phone {work=123456-2, home=2222}, hired 1/Jul/2003, weeklyhours 40.0, $10000.0), PartTimeEmployee(3, emp3Last, emp3First, born 5/Sep/1972, phone {work=123456-3, home=3333}, hired 15/Aug/2002, weeklyhours 19.0, $15000.0), PartTimeEmployee(4, emp4Last, emp4First, born 6/Sep/1973, phone {work=124456-3, home=3343}, hired 15/Apr/2001, weeklyhours 0.0, $13000.0), FullTimeEmployee(5, emp5Last, emp5First, born 5/Jul/1962, phone {work=126456-3, home=3363}, hired 15/Aug/1998, weeklyhours 0.0, $45000.0)]
> got:      []
> 14:22:46,812 (main) INFO  [org.apache.jdo.tck] - Exception during setUp or runtest: 
> junit.framework.AssertionFailedError: Assertion A14.6.9-2 (DistintCandidateInstances) failed: 
> Wrong query result: 
> expected: [FullTimeEmployee(1, emp1Last, emp1First, born 10/Jun/1970, phone {work=123456-1, home=1111}, hired 1/Jan/1999, weeklyhours 40.0, $20000.0), FullTimeEmployee(2, emp2Last, emp2First, born 22/Dec/1975, phone {work=123456-2, home=2222}, hired 1/Jul/2003, weeklyhours 40.0, $10000.0), PartTimeEmployee(3, emp3Last, emp3First, born 5/Sep/1972, phone {work=123456-3, home=3333}, hired 15/Aug/2002, weeklyhours 19.0, $15000.0), PartTimeEmployee(4, emp4Last, emp4First, born 6/Sep/1973, phone {work=124456-3, home=3343}, hired 15/Apr/2001, weeklyhours 0.0, $13000.0), FullTimeEmployee(5, emp5Last, emp5First, born 5/Jul/1962, phone {work=126456-3, home=3363}, hired 15/Aug/1998, weeklyhours 0.0, $45000.0), FullTimeEmployee(1, emp1Last, emp1First, born 10/Jun/1970, phone {work=123456-1, home=1111}, hired 1/Jan/1999, weeklyhours 40.0, $20000.0), FullTimeEmployee(2, emp2Last, emp2First, born 22/Dec/1975, phone {work=123456-2, home=2222}, hired 1/Jul/2003, weeklyhours 40.0, $10000.0), PartTimeEmployee(3, emp3Last, emp3First, born 5/Sep/1972, phone {work=123456-3, home=3333}, hired 15/Aug/2002, weeklyhours 19.0, $15000.0), PartTimeEmployee(4, emp4Last, emp4First, born 6/Sep/1973, phone {work=124456-3, home=3343}, hired 15/Apr/2001, weeklyhours 0.0, $13000.0), FullTimeEmployee(5, emp5Last, emp5First, born 5/Jul/1962, phone {work=126456-3, home=3363}, hired 15/Aug/1998, weeklyhours 0.0, $45000.0)]
> got:      []
> 	at junit.framework.Assert.fail(Assert.java:47)
> 	at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:546)
> 	at org.apache.jdo.tck.query.QueryTest.queryFailed(QueryTest.java:500)
> 	at org.apache.jdo.tck.query.QueryTest.checkQueryResultWithoutOrder(QueryTest.java:485)
> 	at org.apache.jdo.tck.query.QueryTest.execute(QueryTest.java:1189)
> 	at org.apache.jdo.tck.query.QueryTest.executeJDOQuery(QueryTest.java:1057)
> 	at org.apache.jdo.tck.query.result.DistinctCandidateInstances.testCollectionQueries(DistinctCandidateInstances.java:129)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:324)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:204)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at junit.textui.TestRunner.doRun(TestRunner.java:116)
> 	at junit.textui.TestRunner.doRun(TestRunner.java:109)
> 	at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:120)
> 	at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:95)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira