cayenne memory behaviour

From: martin ruff (mruf..imeon.ch)
Date: Sat Mar 08 2003 - 06:31:01 EST

  • Next message: Arndt Brenschede: "Re: cayenne memory behaviour"

    Hi,
    I have a table cm_user with about 40000 users
    the CayenneDataObject CmUser has a lot of relationsships to other
    objects, means is about 2K each object
    now I have the follwoing code:
                    SelectQuery q = new SelectQuery(CmUser.class);
                    ResultIterator it = null;
                    
                    // ResultIterator operations all throw checked CayenneException
                    try
                    {
                       // special "performIteratedQuery" method is used
                       it = ctxt.performIteratedQuery(q);
                    
                       while(it.hasNextRow())
                       {
                          // ResultIterator always returns data rows
                          Map row = it.nextDataRow();
                          CmUser cmuser = (CmUser)ctxt.objectFromDataRow("CmUser", row);
                          System.out.println("login: " + cmuser.getLogin());
                       }
                    }
                    catch(CayenneException ex)
    ....

    is it correct that the datacontext caches all object that I get by:
    CmUser cmuser = (CmUser)ctxt.objectFromDataRow("CmUser", row); ?
    which means at the end I have 40000 CmUser objects in memory?
    if this is the case, is there a way to prevent the datacontext from
    caching objects?

    What is the "memory" and "performance" best way to solve the problem,
    that in my code I HAVE to access EVERY user?
    thanks for help
    martin



    This archive was generated by hypermail 2.0.0 : Sat Mar 08 2003 - 06:31:54 EST