Very strange behavior of my cayenne application

From: johannes schmidt (e002753..tudent.tuwien.ac.at)
Date: Fri Nov 19 2004 - 10:00:36 EST

  • Next message: Gentry, Michael: "RE: How do you create a custom DB Adapter?"

    hi!
    my cayenne application is behaving very strangly: I think it's a library
    problem but i can't fix it!
    The cayenne application always ran perfect without any faults but yesterday
    i lost my jbuilder-project files (containing the library information) and
    had to find again the libraries to include in my application.
    I'm sure that i used cayenne version 1.0 and the mysql 3.0.6 stable jdbc
    driver. I know that I used a lot of jars as libraries that weren't really
    useful and thought that it would be enough to just bind the cayenne and the
    mysql libraries. The program really compiles and runs perfectly, BUT there
    is one problem, the following code:
    this.db=(WohntIn)ctxt.createAndRegisterNewObject("WohntIn");
    this.db.setAdresse((Adresse)this.dbcAdresse.getSelectedItem());
    this.db.setPerson(this.dbp.getPerson());

    the code works perfectly, only when person (which is what we get when we
    call this.dbp.getPerson()) is a newly created enitity (already commited to
    the database) I get the following exception:

    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.0 September 20 2003]
    Some parts of FK are missing in snapshot.
     at
    org.objectstyle.cayenne.map.DbRelationship.srcSnapshotWithTargetSnapshot(DbR
    elationship.java:261)
     at
    org.objectstyle.cayenne.map.DbRelationship.srcFkSnapshotWithTargetSnapshot(D
    bRelationship.java:281)
     at
    org.objectstyle.cayenne.access.util.PrimaryKeyHelper.appendPkFromMasterRelat
    ionships(PrimaryKeyHelper.java:244)
     at
    org.objectstyle.cayenne.access.util.PrimaryKeyHelper.createPermIdsForObjEnti
    ty(PrimaryKeyHelper.java:164)
     at
    org.objectstyle.cayenne.access.ContextCommit.createPrimaryKeys(ContextCommit
    .java:517)
     at
    org.objectstyle.cayenne.access.ContextCommit.commit(ContextCommit.java:139)
     at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:73
    4)
     at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:70
    8)
     at
    akj.ui.general.dbFieldPanes.person_adresseDbFieldPane.save(person_adresseDbF
    ieldPane.java:133)
     at
    akj.ui.general.dbFieldPanes.person_adresseDbFieldPane.btnAdd_actionPerformed
    (person_adresseDbFieldPane.java:107)
     at
    akj.ui.general.dbFieldPanes.person_adresseDbFieldPane$1.actionPerformed(pers
    on_adresseDbFieldPane.java:76)
    [...]
    Person looks like this:
    {[ Pfarre => {<oid: akj.database.cayenneDataObjects.Pfarre: <Einrichtung:
    keine pfarre angegeben>; state: committed>}

     Adresse => {<oid: akj.database.cayenneDataObjects.Adresse: <Adress_ID:
    24400>; state: committed>}

     anrede => Herr
     spitzname =>
     titel =>
     EMail => (org.objectstyle.cayenne.access.ToManyList)
     Mobil => (org.objectstyle.cayenne.access.ToManyList)
     Kaufposten => (org.objectstyle.cayenne.access.ToManyList)
     mehrfachzusendungen => false
     geschlecht => M
     nachname => lbl
     homepage =>
     anmerkungen =>
     vorname => lbl
    ]<oid: akj.database.cayenneDataObjects.Person: <P_ID: null>; state:
    committed>}

    The interesting fact: P_ID is null!
    I'm quite sure that I did use the cayenne 1.0 jar before and I'm absolutly
    sure that it did work - and I didn't change a single line of code in my
    application! I'm really stuck and think that all this is related to some
    kind of library problem: does anybody know if cayenne uses a special
    xml-parser or stuff like that which could cause the problem? (I tried it
    with JDK 1.4. and 1.5. - the same problem!)
    I would really appreciate any help,
    johannes



    This archive was generated by hypermail 2.0.0 : Fri Nov 19 2004 - 10:00:37 EST