Re: toMany relationship not fetched

From: Robert Zeigler (robert..uregumption.com)
Date: Thu Apr 13 2006 - 01:08:03 EDT

  • Next message: Andrus Adamchik: "Re: toMany relationship not fetched"

    Interesting...I also had faulting issues with 1.2B1. (past tense because
    I needed a fix very fast; so I downgraded back to M5, which is what I
    was using before). The error I was getting wasn't a "toMany"
    relationship, though. But, the behavior there was also a bit
    stochastic... sometimes it worked, and sometimes it didn't; in May,
    things will be in more of a position for myself (and also for the
    company using the software) to where I can dig deeper into this. In the
    meanwhile, this is the exception I was getting:

    org.objectstyle.cayenne.FaultFailureException
    [v.1.2B1 April 6 2006] Error resolving fault, no matching row exists in
    the database for ObjectId: <ObjectId:AssignmentParameters,
    assignmentid=1590>
    unlabeledMessage: Error resolving fault, no matching row exists in the
    database for ObjectId: <ObjectId:AssignmentParameters, assignmentid=1590>
    Stack Trace:

        * org.objectstyle.cayenne.access.DataContext.prepareForAccess(DataContext.java:1742)

        * org.objectstyle.cayenne.CayenneDataObject.readProperty(CayenneDataObject.java:238)

        * org.eledge.domain.auto._AssignmentParameters.getPermitInvalidTransactions(_AssignmentParameters.java:68)

        * org.eledge.domain.Assignment.assignmentDoable(Assignment.java:49)
        * org.eledge.components.AssignmentTransactionCreator.doTransaction(AssignmentTransactionCreator.java:23)

        * org.eledge.pages.ViewAssignment.activateExternalPage(ViewAssignment.java:32)

        * org.apache.tapestry.engine.ExternalService.service(ExternalService.java:161)

        * org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:889)

        * org.eledge.EledgeEngine.service(EledgeEngine.java:60)
        * org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:198)

        * org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:159)

        * javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        * javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

        * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

        * org.eledge.OldEledgePagesFilter.doFilter(OldEledgePagesFilter.java:64)

        * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)

        * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

        * org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

        * org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

        * org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

        * org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        * org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)

        * org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

        * org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

        * org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        * org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)

        * org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

        * org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

        * org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

        * org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

        * org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)

        * org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

        * org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)

        * org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

        * org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

        * org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        * org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

        * org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

        * org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

        * org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        * org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:429)

        *

        * org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:495)
        * java.lang.Thread.run(Thread.java:534)

    I double checked, and there all of the relationships are correct in the
    db (and, despite what the exception says, there is a row in
    AssignmentParameters with the assignmentid FK of 1590).

    Line 49 of Assignment.java looks like:

                if
    (this.getParameters().getPermitInvalidTransactions().booleanValue()) {

    Line 68 of _AssignmentParameters.java looks like:

            return (Boolean)readProperty("permitInvalidTransactions");

    I'll look into this deeper, like I said, probably at the beginning of
    May... I didn't mention it before since I haven't had time to check if
    it was a a "me" issue or a "cayenne" issue. But th fact that other
    people seem to be having some trouble with fault resolving suggests that
    it's not a "me issue", so I thought I'd add what little information I
    have atm.

    Robert

    Marcin Skladaniec wrote:
    > Hello everyone !
    >
    > Andrus, thank you for fixing that bug so quickly !
    >
    >
    > I got another problem, it may be related to previous thats why I post
    > it here.
    >
    > It does not happen always, I tried to create a separate project to
    > reproduce it, but I couldn't.
    >
    > This is the code which reproduces problem in my application:
    >
    > CayenneContext context =
    > ContextManager.getNewDedicatedContext();
    > List students = context.performQuery(new
    > SelectQuery(Student.class));
    > for (int i=0 ; i<students.size();i++) {
    > Student student = (Student)students.get(i);
    >
    > //this works ...
    > logger.info(i+ ") students count = "
    > +student.getLanguage().getStudents().size());
    >
    > //this don't work
    > logger.info(i+ ") language name = "
    > +student.getLanguage().getName());
    > }
    >
    > CayenneContext context2 =
    > ContextManager.getNewDedicatedContext();
    > List languages = context2.performQuery(new
    > SelectQuery(Language.class));
    > for (int i=0 ; i< languages.size();i++) {
    > Language language = (Language)languages.get(i);
    > if (language.getStudents().size() > 0) {
    >
    > logger.info(i+ ") language name = "
    > +language.getName());
    > logger.info(i+ ") students count = "
    > +language.getStudents().size());
    >
    > for (int j
    > =0;j<language.getStudents().size();j++) {
    > Student student =
    > ((Student)language.getStudents().get(j));
    > logger.info("\t"+j+ ") student name = "
    > +student.getFullName());
    > logger.info("\t"+j+ ") student language =
    > " +student.getLanguage().getName());
    >
    > }
    > }
    > }
    >
    > On output I'm getting :
    >
    > - 0) students count = 1
    > - 0) language name = null
    > - 1) students count = 1
    > - 1) language name = null
    > - 2) students count = 1
    > - 2) language name = null
    >
    > - 8) language name = Galic
    > - 8) students count = 1
    > - 0) student name = test test
    > - 0) student language = Galic
    > - 1287) language name = Guatamalan
    > - 1287) students count = 1
    > - 0) student name = test2 test2
    > - 0) student language = Guatamalan
    > - 1509) language name = English
    > - 1509) students count = 1
    > - 0) student name = test3 test3
    > - 0) student language = English
    >
    > It looks like sometimes the object is not "faulted" correctly. I can't
    > see when and why ...
    >
    >
    > Marcin
    >
    >
    > On 11/04/2006, at 5:35 PM, Andrus Adamchik wrote:
    >
    >> Ok, now I got it. This is a bug - RelationshipQuery was incorrectly
    >> intercepted by the client CayenneContext. I opened a bug report:
    >>
    >> http://objectstyle.org/jira/browse/CAY-500
    >>
    >> and actually already checked in the fix, so it should be available in
    >> 04/11 nightly build.
    >>
    >> Thanks
    >> Andrus
    >>
    >>
    >> On Apr 11, 2006, at 4:58 AM, Marcin Skladaniec wrote:
    >>
    >>
    >
    > -------------------------->
    > ish
    > http://www.ish.com.au
    > Level 1, 30 Wilson Street Newtown 2042 Australia
    > phone +61 2 9550 5001 fax +61 2 9550 4001
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Apr 13 2006 - 01:08:33 EDT