Re: To severe things

From: Jan Lendholt (jlendhol..otmail.com)
Date: Fri Sep 14 2007 - 07:59:05 EDT

  • Next message: Michael Gentry: "Re: [C3] logging"

    Hi Kevin,

    To (1):

    two snippets I can give you. Unfortunately we do not have a fitting test
    case.

    The "faulty" object is stored in a list and the delete via
    context.deleteObject:

    //Thios expression fetches all persons that should be deleted from a note
    Expression delExp =
    ExpressionFactory.matchExp(Mappingnotizperson.TO_NOTIZ_PROPERTY,
    notiz.getObjectId()).andExp(ExpressionFactory.matchExp(Mappingnotizperson.TO_PERSONEN_PROPERTY,
    each.getObjectId()));

                                                    SelectQuery selQ = new SelectQuery(Mappingnotizperson.class,delExp);

    //perform the query
    List<Mappingnotizperson> m = this.context.performQuery(selQ);
    //Delete the object
    this.context.deleteObject(m.get(0));
    this.context.commitChanges();

    Now the corresponding object is marked as transient and is deleted.

    //This refetches all persons that are assigned to one note.
    List<Mappingnotizperson> mapList = this.notiz.getMappingnotizpersonArray();
                            System.err.println("notizid:"+ notizShow.getObjectId());
                            for (Mappingnotizperson mappingnotizperson : mapList) {
                                    System.err.println("mapp: pers-state:" +
    mappingnotizperson.getPersistenceState()); // + " --- persid:" +
    mappingnotizperson.getToPersonen());
                                    this.persList.add(mappingnotizperson.getToPersonen()); //**
                                    this.existPers.add(mappingnotizperson.getToPersonen());
                            }

    ** Here we get the NullPointerException that tells us, that the person of
    this mapping is null.

    Hope you can start with what we've got.

    To (2):

    We're using cayenne 2.0.3 with a customized db adapter to be used with max
    db.

    To me, the method prepareForAccess makes no sense.
    At first it's checked againstz being hollow and afterwards it's checked
    against being commited - but how should it be commited when it's already
    hollow??

    Thanks in advance guys.

    Jan

    >From: Kevin Menard <kmenar..ervprise.com>
    >Reply-To: use..ayenne.apache.org
    >To: <use..ayenne.apache.org>
    >Subject: Re: To severe things
    >Date: Thu, 13 Sep 2007 15:21:52 -0400
    >
    >Hi Jan,
    >
    >I'm snipping out a lot of just to get to a few basic questions I have.
    >
    >
    >On 9/13/07 1:25 PM, "Jan Lendholt" <jlendhol..otmail.com> wrote:
    >
    > > Well, this exception comes on an object with the PersistenceState =
    > > Transient. The exception is thrown when in doResolveFault cayenne tries
    >to
    > > access the object's context.
    > > But why? This object shouldn't even be there! In my opinion this is a
    >bug.
    > > It doesn't matter, if we delete the object with deletObject or with a
    >delet
    > > query. How can it be? It's pretty severe though.
    >
    >If possible, could you please post the code that seems to trigger the
    >error?
    >A small test case would be perfect, but showing anything would be helpful.
    >
    > > (2)
    > > I try to access a mapping table again, this time we manage resources
    >like
    > > rooms, beamers etc.
    > >
    > > I get all mappings and try to access via
    >mapping.getToResource().getname()
    > > the resource's name.
    > >
    > > We get:
    > >
    > > 19:22:49.168 WARN!! Exception for /ams?serviceId=Echo.Synchronize
    > > org.apache.cayenne.FaultFailureException: [v..AYENNE_VERSION@
    > >..AYENNE_BUILD_DATE@] Error resolving fault for ObjectId:
    > > <ObjectId:Resource, IDRESOURCE=1> and state (hollow). Possible cause -
    > > matching row is missing from the database.
    >
    >What version of Cayenne are you actually using?
    >
    >--
    >Kevin
    >

    _________________________________________________________________
    Haben Spinnen Ohren? Finden Sie es heraus – mit dem MSN Suche Superquiz via
    http://www.msn-superquiz.de Jetzt mitmachen und gewinnen!



    This archive was generated by hypermail 2.0.0 : Fri Sep 14 2007 - 07:59:43 EDT