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 Watzek (JIRA)" <ji...@apache.org> on 2006/01/30 17:15:33 UTC

[jira] Created: (JDO-285) Fix list of teardown classes in company model reader.

Fix list of teardown classes in company model reader.
-----------------------------------------------------

         Key: JDO-285
         URL: http://issues.apache.org/jira/browse/JDO-285
     Project: JDO
        Type: Bug
  Components: tck20  
    Reporter: Michael Watzek
 Assigned to: Michael Watzek 


The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.


-- 
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


[jira] Updated: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Michael Watzek (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-285?page=all ]

Michael Watzek updated JDO-285:
-------------------------------

    Attachment: JDO-285.patch

The attached patch fixes this issue. It contains two changes:

1) It fixes the order of teardown classes,
2) It fixes call getExtent with subclasses equals true in method getAllObjects.

Some more comments related to this patch:

After this patch is applied, configuration inheritance4 will fail for both, application identity and datastore identity. The runs for both identity types throw exceptions during tearDown:

- Application identity: 
javax.jdo.JDOFatalUserException: Cannot create new instance of class "org.apache.jdo.tck.pc.company.Employee". If this is an abstract class, make sure you dont have a row for that class in the database without a corresponding row in any concrete subclass table.  (see below)

- Datastore identity:
java.lang.NullPointerException  (see below)

As a consequence, subsequent runs will throw duplicate key exceptions unless you clear schema4 manually. 

There are two more issues related to this patch: 

1) Running configuration inheritance4 is very slow. On my system, it takes about 6 minutes. Usually, inheritance4 takes less than 1 minute. 
2) Memory consumption is increasing, when inheritance4 is run with this patch. The VM size is about 550 MB. Without this patch th VM size is about 30 MB running configuration inheritance4.

For these reasons, we propose that JPOX first fixes the problems above, before the patch is checked in.

doRuntck.jdori:
    [java] RUN CompletenessTest.test       ERROR
    [java] Description: Completeness test with inheritance mapping 4: Person, Employee, and Insurance have inheritance s
trategy new-table. PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance have inheritance strategy s
uperclass-table.
    [java] Time: 082
    [java] There was 1 error:
    [java] 1) test(org.apache.jdo.tck.mapping.CompletenessTest)javax.jdo.JDOFatalException: Exception during tearDown
    [java]      at org.apache.jdo.tck.JDO_Test.tearDown(JDO_Test.java:306)
    [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:234)
    [java]      at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:120)
    [java]      at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:95)
    [java] NestedThrowablesStackTrace:
    [java] javax.jdo.JDOFatalUserException: Cannot create new instance of class "org.apache.jdo.tck.pc.company.Employee"
. If this is an abstract class, make sure you dont have a row for that class in the database without a corresponding row
 in any concrete subclass table.
    [java]      at org.jpox.state.StateManagerImpl.<init>(StateManagerImpl.java:420)
    [java]      at org.jpox.AbstractPersistenceManager.getObjectByAID(AbstractPersistenceManager.java:2326)
    [java]      at org.jpox.store.query.PersistentIDROF.getObjectByAID(PersistentIDROF.java:211)
    [java]      at org.jpox.store.query.PersistentIDROF.getObject(PersistentIDROF.java:162)
    [java]      at org.jpox.store.query.ForwardQueryResult.nextResultSetElement(ForwardQueryResult.java:113)
    [java]      at org.jpox.store.query.ForwardQueryResult.advanceToEndOfResultSet(ForwardQueryResult.java:103)
    [java]      at org.jpox.store.query.ForwardQueryResult.closingConnection(ForwardQueryResult.java:164)
    [java]      at org.jpox.AbstractPersistenceManager.notifyQueriesOfConnectionClose(AbstractPersistenceManager.java:32
41)
    [java]      at org.jpox.AbstractPersistenceManager.preRollback(AbstractPersistenceManager.java:3253)
    [java]      at org.jpox.NonmanagedTransaction.rollback(NonmanagedTransaction.java:554)
    [java]      at org.apache.jdo.tck.JDO_Test.cleanupPM(JDO_Test.java:473)
    [java]      at org.apache.jdo.tck.JDO_Test.cleanupPM(JDO_Test.java:460)
    [java]      at org.apache.jdo.tck.JDO_Test.deleteTearDownClasses(JDO_Test.java:402)
    [java]      at org.apache.jdo.tck.JDO_Test.localTearDown(JDO_Test.java:318)
    [java]      at org.apache.jdo.tck.JDO_Test.tearDown(JDO_Test.java:287)
    [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:234)
    [java]      at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:120)
    [java]      at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:95)
    [java] FAILURES!!!
    [java] Error summary:
    [java] 001 error:  javax.jdo.JDOFatalUserException: Cannot create new instance of class "org.apache.jdo.tck.pc.compa
ny.Employee". If this is an abstract class, make sure you dont have a row for that class in the database without a corre
sponding row in any concrete subclass table.
    [java] derby-app-inheritance4-junit.txt:
    [java]     ** Tests run: 001, Time: 082 seconds. Failures: 0, Errors: 1
    [java] Excluded tests: [org.apache.jdo.tck.enhancement.FieldAccessModified, org.apache.jdo.tck.enhancement.Implement
sPersistenceCapable]
    [java] [ERROR] Java Result: 1
    [echo] Finished run with database="derby" identitytype="applicationidentity" mapping="4".

exclude:

doRuntck.jdori:
Overriding previous definition of reference to this.jdori.classpath
    [java] RUN CompletenessTest.test       ERROR
    [java] Description: Completeness test with inheritance mapping 4: Person, Employee, and Insurance have inheritance s
trategy new-table. PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance have inheritance strategy s
uperclass-table.
    [java] Time: 239
    [java] There was 1 error:
    [java] 1) test(org.apache.jdo.tck.mapping.CompletenessTest)javax.jdo.JDOFatalException: Exception during tearDown
    [java]      at org.apache.jdo.tck.JDO_Test.tearDown(JDO_Test.java:306)
    [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:234)
    [java]      at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:120)
    [java]      at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:95)
    [java] NestedThrowablesStackTrace:
    [java] java.lang.NullPointerException
    [java]      at org.jpox.state.StateManagerImpl.replaceFields(StateManagerImpl.java:2886)
    [java]      at org.jpox.store.query.PersistentIDROF$2.fetchFields(PersistentIDROF.java:243)
    [java]      at org.jpox.state.StateManagerImpl.loadFieldValues(StateManagerImpl.java:801)
    [java]      at org.jpox.state.StateManagerImpl.<init>(StateManagerImpl.java:511)
    [java]      at org.jpox.AbstractPersistenceManager.getObjectById(AbstractPersistenceManager.java:2367)
    [java]      at org.jpox.store.query.PersistentIDROF.getObjectById(PersistentIDROF.java:238)
    [java]      at org.jpox.store.query.PersistentIDROF.getObject(PersistentIDROF.java:175)
    [java]      at org.jpox.store.query.ForwardQueryResult.nextResultSetElement(ForwardQueryResult.java:113)
    [java]      at org.jpox.store.query.ForwardQueryResult.advanceToEndOfResultSet(ForwardQueryResult.java:103)
    [java]      at org.jpox.store.query.ForwardQueryResult.closingConnection(ForwardQueryResult.java:164)
    [java]      at org.jpox.AbstractPersistenceManager.notifyQueriesOfConnectionClose(AbstractPersistenceManager.java:32
41)
    [java]      at org.jpox.AbstractPersistenceManager.preRollback(AbstractPersistenceManager.java:3253)
    [java]      at org.jpox.NonmanagedTransaction.rollback(NonmanagedTransaction.java:554)
    [java]      at org.apache.jdo.tck.JDO_Test.cleanupPM(JDO_Test.java:473)
    [java]      at org.apache.jdo.tck.JDO_Test.cleanupPM(JDO_Test.java:460)
    [java]      at org.apache.jdo.tck.JDO_Test.deleteTearDownClasses(JDO_Test.java:402)
    [java]      at org.apache.jdo.tck.JDO_Test.localTearDown(JDO_Test.java:318)
    [java]      at org.apache.jdo.tck.JDO_Test.tearDown(JDO_Test.java:287)
    [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:234)
    [java]      at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:120)
    [java]      at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:95)
    [java] FAILURES!!!
    [java] Error summary:
    [java] 001 error:  java.lang.NullPointerException
    [java] derby-dsid-inheritance4-junit.txt:
    [java]     ** Tests run: 001, Time: 239 seconds. Failures: 0, Errors: 1
    [java] Excluded tests: [org.apache.jdo.tck.enhancement.FieldAccessModified, org.apache.jdo.tck.enhancement.Implement
sPersistenceCapable]
    [java] [ERROR] Java Result: 1
    [echo] Finished run with database="derby" identitytype="datastoreidentity" mapping="4".


result:
    [java] Total tests run: 2. Failures: 0, Errors: 2.
    [java] 2 of 2 configurations failed.
    [java] See file 'F:\users\brazil\jdo-cmp\jdo\trunk\tck20/target/logs/20060130-154940\TCK-results.txt' for details.
BUILD SUCCESSFUL
Total time: 6 minutes 18 seconds
Finished at: Mon Jan 30 15:55:03 CET 2006

> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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


[jira] Commented: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JDO-285?page=comments#action_12371348 ] 

Craig Russell commented on JDO-285:
-----------------------------------

Considering the timing, I propose that we not fix this for JDO 2.0.

> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Versions: JDO 2 beta
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>      Fix For: JDO 2 final
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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


[jira] Commented: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Michael Watzek (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JDO-285?page=comments#action_12368136 ] 

Michael Watzek commented on JDO-285:
------------------------------------

Hi Andy,

the exceptions above can be reproduced executing the code below in conjunction with mapping 4. The code makes persistent a full time employee and iterates the person extent using subclasses equals true. Note, that the exceptions can be reproduces on a clean database with only one full time employee. The exceptions are thrown from call Iterator.next() in line "collection.iterator().next();".

Regards,
Michael

        PersistenceManager pm = getPM();
        FullTimeEmployee emp = new FullTimeEmployee(1, "first", "last", "middle", 
                new Date(), new Date(), 1000.0);
        pm.currentTransaction().begin();
        pm.makePersistent(emp);
        pm.currentTransaction().commit();
        
        pm.currentTransaction().begin();
        Extent extent = pm.getExtent(Person.class, true);
        Query query = pm.newQuery();
        query.setClass(Person.class);
        query.setCandidates(extent);
        Collection collection = (Collection) query.execute();
        collection.iterator().next();
        pm.currentTransaction().commit();


> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Versions: JDO 2 beta
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>      Fix For: JDO 2 final
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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


[jira] Updated: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-285?page=all ]

Craig Russell updated JDO-285:
------------------------------

    Fix Version: JDO 2 final
                     (was: JDO 2 rc1)

> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Versions: JDO 2 beta
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>      Fix For: JDO 2 final
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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


[jira] Updated: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-285?page=all ]

Craig Russell updated JDO-285:
------------------------------

    Fix Version:     (was: JDO 2 final)

We should take a look at this for a maintenance release.

> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Versions: JDO 2 beta
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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


[jira] Resolved: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-285?page=all ]
     
Craig Russell resolved JDO-285:
-------------------------------

    Resolution: Won't Fix
     Assign To: Craig Russell  (was: Michael Watzek)

Changing the teardown strategy is unwise, as a bug in the implementation would make all of the completeness tests fail. Instead of changing the teardown implementation, we should add specific tests for the cases of interest.

> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug

>   Components: tck20
>     Versions: JDO 2 beta
>     Reporter: Michael Watzek
>     Assignee: Craig Russell
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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


[jira] Commented: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JDO-285?page=comments#action_12365106 ] 

Andy Jefferson commented on JDO-285:
------------------------------------

Further comment : both of these issues are trying to read the results of queries, before the connection is closed while rolling back). What is the query that was executed just before ? and what is the SQL invoked by JPOX ? (in the JPOX log). This should have a column "XXX as JPOXMETADATA" or a discriminator column. This should define the type of the real object in the datastore, and then JPOX is trying to create an instance of it. Is the SQL correct for the query ? Is the value of this class being returned incorrectly and consequently JPOX tries to create an instance of an abstract class (or rather JDOImplHelper.newInstance is asked to but returns null for the class Employee ... why would it do that ?)

> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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


[jira] Commented: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JDO-285?page=comments#action_12365104 ] 

Andy Jefferson commented on JDO-285:
------------------------------------

Hi Michael,
can you please provide a cut down guide on what the first of these problems is? What are you calling exactly ? The stack trace says rollback !? (but what caused that?) On which class ? (Employee ?) and what inheritance does it have ? [I don't want to get into taking patches]

What I'm getting at is, can I get a simplified testcase that reproduces it ? ... debugging through a large company model just to find something is time-consuming :-( Can it be cut down to just 3 or 4 classes, and then call pm.deletePersistentAll or something ?

> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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


[jira] Updated: (JDO-285) Fix list of teardown classes in company model reader.

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-285?page=all ]

Craig Russell updated JDO-285:
------------------------------

    Fix Version: JDO 2 rc1
        Version: JDO 2 beta

> Fix list of teardown classes in company model reader.
> -----------------------------------------------------
>
>          Key: JDO-285
>          URL: http://issues.apache.org/jira/browse/JDO-285
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Versions: JDO 2 beta
>     Reporter: Michael Watzek
>     Assignee: Michael Watzek
>      Fix For: JDO 2 rc1
>  Attachments: JDO-285.patch
>
> The list of teardown classes in company model should not contain subclasses of inheritance hierarchies insurance and person. In t-conference, Jan 27, we agreed that the correct order is: Insurance.class, Person.class, Department.class, Company.class, Project.class.

-- 
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