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 <mb...@spree.de> on 2005/07/21 19:44:20 UTC

Problem with self-referencing relationship

Hi Erik, hi Andy,

when running the CompletenessTest I ran into a JDODataStoreException 
saying that a column name is in more than one table in the FROM list. I 
have the feeling it has to do with self-referencing relationships 
(Employee<->Employee). In this case the table in the OUTER JOIN is the 
same as the one in the FROM clause, so I think it needs an 
identification variable. I filed a JIRA issue JDO-93 with more details 
(configuration and stacktrace) for this.

Thanks!

Regards Michael
-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin			

Re: Problem with self-referencing relationship

Posted by Andy Jefferson <an...@jpox.org>.
> I can run "companyNoRelationships.conf" several times without
> reinstalling the schema. The result is always the same:

Hi Michael,

I get the same as you, today! but certainly didn't yesterday. Since I can't 
reproduce it myself now, someone please just close the issue (JIRA-116) and 
if I find what was causing it I'll re-raise it with clearer instructions :-)



On an unrelated note, can someone please add the following 2 lines to 
"test/conf/logging.properties"

log4j.category.com.mchange.v2.c3p0=INFO, A1
log4j.category.com.mchange.v2.resourcepool=INFO, A1

These will mean that the message on the console :-
log4j:WARN No appenders could be found for logger (com.mchange.v2.log.MLog).
log4j:WARN Please initialize the log4j system properly.

when running the TCK (coming from C3P0) will not appear.




-- 
Andy

Running a single test in fostore20 (was Re: Problem with self-referencing relationship)

Posted by Michael Bouschen <mb...@spree.de>.
Hi,

[...]

>> I heard you mentioning on the conference call that i 
>> could run an individual test in maven, could you please tell me how to do 
>> that?
> 
> 
> It depends on which project you're running. The TCK can run a single 
> configuration (combination of database, test data, and test program. In 
> the tck20 directory maven help should give you the details.
> 
> If you're in the fostore20 project, it's a work in progress. I don't see 
> any way to run a single test. That would be a good thing to add to the 
> maven.xml. Something like a system property so you could do:

maven has some builtin support to run JUnit tests (it is the Maven Test 
Plug-in). The build goal uses this plugin to run all the specified JUnit 
tests. The plugin provides a goal test:single to run a single which can 
be used in the fostore20 subproject:
   maven -Dtestcase=org.apache.jdo.test.Test_EmpDeptAppId test:single

Please note, this does not work in the tck20 subproject, since it runs 
configurations not single test cases.

Regards Michael

> 
> maven -Djdo.test.name=org.apache.jdo.test.Test_EmpDeptAppId run.single
> 
>> My fostore20 tests are all having errors? Is anybody else facing the 
>> same problems with fostore20 (i hope its nothing to do with file 
>> permissions 
>> or something-- but my guess is that should result in failures instead of 
>> errors)
> 
> 
> I checked in a fix for FOStorePMF and StateManagerImpl to meet the JDO2 
> requirements this afternoon. When I run fostore20 now, I just get one 
> error related to the new jdoNewObjectIdInstance that changed between 
> JDO1 and JDO2. 
> Running org.apache.jdo.test.Test_EmpDeptAppId
>     [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 10.737 sec
>     [junit] [ERROR] TEST org.apache.jdo.test.Test_EmpDeptAppId FAILED
> 
> Craig
> 
>>
>> On 8/8/05, Craig Russell <Craig.Russell@sun.com 
>> <ma...@sun.com>> wrote:
>>
>>>
>>> Hi Andy, Karan,
>>> On Aug 8, 2005, at 11:30 AM, Andy Jefferson wrote:
>>>
>>> Any update on this?
>>>
>>>
>>> Not from me. Not had time to look at it. Don't know if Erik has.
>>>
>>> Out of interest, how do I run this "CompletenessTest" on its own ? 
>>> (since 
>>> it's 
>>> not in alltests.conf). I've tried running "companyNoRelationships.conf", 
>>> which is fine for 1 run, but if I run it again it tries to insert the 
>>> same 
>>> data again and causes duplicate key issues. Tests should be cleaning 
>>> themselves out so they leave the datastore in the same state as it 
>>> was at 
>>> startup (IMHO).
>>>
>>>
>>> I completely agree. Please file a JIRA on this issue. CompletenessTest 
>>> didn't get the message about cleaning up after itself. ;-)
>>>
>>> Karan,
>>>
>>> This is probably a good way to learn about one of the main components of 
>>> our O/R mapping test framework.
>>>
>>> Craig
>>>
>>>
>>> -- 
>>> Andy
>>>
>>>
>>> Craig Russell
>>>
>>> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
>>>
>>> 408 276-5638 mailto:Craig.Russell@sun.com <Craig.Russell@sun.com 
>>> <ma...@sun.com>>
>>>
>>> P.S. A good JDO? O, Gasp!
>>>
>>>
>>>
>>>
>>
>>
>> -- 
>> Karan Malhi
>>
> 
> Craig Russell
> 
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 
> 408 276-5638 mailto:Craig.Russell@sun.com
> 
> P.S. A good JDO? O, Gasp!
> 
> 


-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin			

Re: Problem with self-referencing relationship

Posted by Craig Russell <Cr...@Sun.COM>.
Hi Karan,

On Aug 8, 2005, at 8:23 PM, Karan Malhi wrote:

> Hi Craig,
>
> I dont know anything about this "Completeness Test" . I do know  
> that the tck
> requirements is that the test should leave the database in a clean  
> state. Is
> this what the completeness test does (check to see if db is clean)?

When I suggested you look at the completeness test, I was thinking  
that there was some work to do to clean it up, but I looked again and  
it's not the test's fault.

> Where do
> i look for this test?

Completeness test can be found by find . -name "Complete*" in the  
tck20 directory. You can also find it by looking in the test/conf  
directory for configurations that use it: grep Complete ` find . - 
name "*.conf"`.

> I heard you mentioning on the conference call that i
> could run an individual test in maven, could you please tell me how  
> to do
> that?

It depends on which project you're running. The TCK can run a single  
configuration (combination of database, test data, and test program.  
In the tck20 directory maven help should give you the details.

If you're in the fostore20 project, it's a work in progress. I don't  
see any way to run a single test. That would be a good thing to add  
to the maven.xml. Something like a system property so you could do:

maven -Djdo.test.name=org.apache.jdo.test.Test_EmpDeptAppId run.single

> My fostore20 tests are all having errors? Is anybody else facing the
> same problems with fostore20 (i hope its nothing to do with file  
> permissions
> or something-- but my guess is that should result in failures  
> instead of
> errors)

I checked in a fix for FOStorePMF and StateManagerImpl to meet the  
JDO2 requirements this afternoon. When I run fostore20 now, I just  
get one error related to the new jdoNewObjectIdInstance that changed  
between JDO1 and JDO2.
Running org.apache.jdo.test.Test_EmpDeptAppId
     [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed:  
10.737 sec
     [junit] [ERROR] TEST org.apache.jdo.test.Test_EmpDeptAppId FAILED

Craig

>
> On 8/8/05, Craig Russell <Cr...@sun.com> wrote:
>
>>
>> Hi Andy, Karan,
>> On Aug 8, 2005, at 11:30 AM, Andy Jefferson wrote:
>>
>> Any update on this?
>>
>>
>> Not from me. Not had time to look at it. Don't know if Erik has.
>>
>> Out of interest, how do I run this "CompletenessTest" on its own ?  
>> (since
>> it's
>> not in alltests.conf). I've tried running  
>> "companyNoRelationships.conf",
>> which is fine for 1 run, but if I run it again it tries to insert  
>> the same
>> data again and causes duplicate key issues. Tests should be cleaning
>> themselves out so they leave the datastore in the same state as it  
>> was at
>> startup (IMHO).
>>
>>
>> I completely agree. Please file a JIRA on this issue.  
>> CompletenessTest
>> didn't get the message about cleaning up after itself. ;-)
>>
>> Karan,
>>
>> This is probably a good way to learn about one of the main  
>> components of
>> our O/R mapping test framework.
>>
>> Craig
>>
>>
>> -- 
>> Andy
>>
>>
>> Craig Russell
>>
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>>
>> 408 276-5638 mailto:Craig.Russell@sun.com <Cr...@sun.com>
>>
>> P.S. A good JDO? O, Gasp!
>>
>>
>>
>>
>
>
> -- 
> Karan Malhi
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Problem with self-referencing relationship

Posted by Karan Malhi <ka...@gmail.com>.
Hi Craig,

I dont know anything about this "Completeness Test" . I do know that the tck 
requirements is that the test should leave the database in a clean state. Is 
this what the completeness test does (check to see if db is clean)? Where do 
i look for this test? I heard you mentioning on the conference call that i 
could run an individual test in maven, could you please tell me how to do 
that? My fostore20 tests are all having errors? Is anybody else facing the 
same problems with fostore20 (i hope its nothing to do with file permissions 
or something-- but my guess is that should result in failures instead of 
errors)

On 8/8/05, Craig Russell <Cr...@sun.com> wrote:
> 
> Hi Andy, Karan,
> On Aug 8, 2005, at 11:30 AM, Andy Jefferson wrote:
> 
> Any update on this?
> 
> 
> Not from me. Not had time to look at it. Don't know if Erik has.
> 
> Out of interest, how do I run this "CompletenessTest" on its own ? (since 
> it's 
> not in alltests.conf). I've tried running "companyNoRelationships.conf", 
> which is fine for 1 run, but if I run it again it tries to insert the same 
> data again and causes duplicate key issues. Tests should be cleaning 
> themselves out so they leave the datastore in the same state as it was at 
> startup (IMHO).
> 
> 
> I completely agree. Please file a JIRA on this issue. CompletenessTest 
> didn't get the message about cleaning up after itself. ;-)
> 
> Karan,
> 
> This is probably a good way to learn about one of the main components of 
> our O/R mapping test framework.
> 
> Craig
> 
> 
> -- 
> Andy
> 
> 
> Craig Russell
> 
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 
> 408 276-5638 mailto:Craig.Russell@sun.com <Cr...@sun.com>
> 
> P.S. A good JDO? O, Gasp!
> 
> 
> 


-- 
Karan Malhi

Re: Problem with self-referencing relationship

Posted by Craig Russell <Cr...@Sun.COM>.
Hi Andy, Karan,

On Aug 8, 2005, at 11:30 AM, Andy Jefferson wrote:

>> Any update on this?
>>
>
> Not from me. Not had time to look at it. Don't know if Erik has.
>
> Out of interest, how do I run this "CompletenessTest" on its own ?  
> (since it's
> not in alltests.conf). I've tried running  
> "companyNoRelationships.conf",
> which is fine for 1 run, but if I run it again it tries to insert  
> the same
> data again and causes duplicate key issues. Tests should be cleaning
> themselves out so they leave the datastore in the same state as it  
> was at
> startup (IMHO).

I completely agree. Please file a JIRA on this issue.  
CompletenessTest didn't get the message about cleaning up after  
itself. ;-)

Karan,

This is probably a good way to learn about one of the main components  
of our O/R mapping test framework.

Craig
>
> -- 
> Andy
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Problem with self-referencing relationship

Posted by Craig Russell <Cr...@Sun.COM>.
Hi Andy,

On Aug 8, 2005, at 11:30 AM, Andy Jefferson wrote:

>> Any update on this?
>>
>
> Not from me. Not had time to look at it. Don't know if Erik has.
>
> Out of interest, how do I run this "CompletenessTest" on its own ?  
> (since it's
> not in alltests.conf). I've tried running  
> "companyNoRelationships.conf",
> which is fine for 1 run, but if I run it again it tries to insert  
> the same
> data again and causes duplicate key issues. Tests should be cleaning
> themselves out so they leave the datastore in the same state as it  
> was at
> startup (IMHO).

I looked into this and found that the CompletenessTest does clean up  
after itself.

There is a method in tearDown that attempts to iterate the list of  
persistent classes and do a delete on each persistent instance.

But if the delete fails due to an implementation problem, there is  
nothing that the test can do.

The failure message (exception during tearDown) might be hidden by  
the failure during setUp or runTest, but we do try.

You may have to run a database cleanup script until the tearDown can  
complete.

Craig
>
> -- 
> Andy
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Problem with self-referencing relationship

Posted by Michael Watzek <mw...@spree.de>.
Hi Andy,

I can run "companyNoRelationships.conf" several times without 
reinstalling the schema. The result is always the same:

"SQL Exception: Column name 
'DATASTOREIDENTITY0.PERSONS.DATASTORE_IDENTITY' is in more than one 
table in the FROM list."

This is JDO-93. I cannot reproduce JDO-116. Have there been any other 
exceptions when you ran "companyNoRelationships.conf" the first time?

Regards,
Michael
>>Any update on this?
> 
> 
> Not from me. Not had time to look at it. Don't know if Erik has.
> 
> Out of interest, how do I run this "CompletenessTest" on its own ? (since it's 
> not in alltests.conf). I've tried running "companyNoRelationships.conf", 
> which is fine for 1 run, but if I run it again it tries to insert the same 
> data again and causes duplicate key issues. Tests should be cleaning 
> themselves out so they leave the datastore in the same state as it was at 
> startup (IMHO).
> 


-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Re: Problem with self-referencing relationship

Posted by Michael Bouschen <mb...@spree.de>.
Hi Andy,

>>>>Any update on this?
>>>
>>>Not from me. Not had time to look at it.
> 
> 
> Now had time, and is fixed in JPOX CVS - in tomorrows (11/08/2005) nightly 
> build. CompletenessTest passes for "companyNoRelationships.conf"
> 

great, it works!

I resolved and closed the corresponding JIRA issue JDO-93.

Regards Mchael
-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin			

Re: Problem with self-referencing relationship

Posted by Craig Russell <Cr...@Sun.COM>.
Great!

Craig

On Aug 10, 2005, at 12:46 AM, Andy Jefferson wrote:

>>>> Any update on this?
>>>>
>>>
>>> Not from me. Not had time to look at it.
>>>
>
> Now had time, and is fixed in JPOX CVS - in tomorrows (11/08/2005)  
> nightly
> build. CompletenessTest passes for "companyNoRelationships.conf"
>
> -- 
> Andy
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Problem with self-referencing relationship

Posted by Andy Jefferson <an...@jpox.org>.
> > > Any update on this?
> >
> > Not from me. Not had time to look at it.

Now had time, and is fixed in JPOX CVS - in tomorrows (11/08/2005) nightly 
build. CompletenessTest passes for "companyNoRelationships.conf"

-- 
Andy

RE: Problem with self-referencing relationship

Posted by er...@jpox.org.
Not from me too. I'm VERY busy in my FULL time job. I will come back
later this week.

Erik Bengtson 

> -----Original Message-----
> From: Andy Jefferson [mailto:andy@jpox.org]
> Sent: Monday, August 08, 2005 8:31 PM
> To: jdo-dev@db.apache.org
> Subject: Re: Problem with self-referencing relationship
> 
> > Any update on this?
> 
> Not from me. Not had time to look at it. Don't know if Erik has.
> 
> Out of interest, how do I run this "CompletenessTest" on its own ?
(since
> it's
> not in alltests.conf). I've tried running
"companyNoRelationships.conf",
> which is fine for 1 run, but if I run it again it tries to insert the
same
> data again and causes duplicate key issues. Tests should be cleaning
> themselves out so they leave the datastore in the same state as it was
at
> startup (IMHO).
> 
> --
> Andy


Re: Problem with self-referencing relationship

Posted by Andy Jefferson <an...@jpox.org>.
> Any update on this?

Not from me. Not had time to look at it. Don't know if Erik has.

Out of interest, how do I run this "CompletenessTest" on its own ? (since it's 
not in alltests.conf). I've tried running "companyNoRelationships.conf", 
which is fine for 1 run, but if I run it again it tries to insert the same 
data again and causes duplicate key issues. Tests should be cleaning 
themselves out so they leave the datastore in the same state as it was at 
startup (IMHO).

-- 
Andy

Re: Problem with self-referencing relationship

Posted by Craig Russell <Cr...@Sun.COM>.
Hi Eric, Andy,

Any update on this?

Thanks,

Craig

On Jul 21, 2005, at 10:44 AM, Michael Bouschen wrote:

> Hi Erik, hi Andy,
>
> when running the CompletenessTest I ran into a  
> JDODataStoreException saying that a column name is in more than one  
> table in the FROM list. I have the feeling it has to do with self- 
> referencing relationships (Employee<->Employee). In this case the  
> table in the OUTER JOIN is the same as the one in the FROM clause,  
> so I think it needs an identification variable. I filed a JIRA  
> issue JDO-93 with more details (configuration and stacktrace) for  
> this.
>
> Thanks!
>
> Regards Michael
> -- 
> Michael Bouschen        Tech@Spree Engineering GmbH
> mailto:mbo.tech@spree.de    http://www.tech.spree.de/
> Tel.:++49/30/235 520-33        Buelowstr. 66
> Fax.:++49/30/2175 2012        D-10783 Berlin
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!