3t and performance

From: Marcin Skladaniec (marci..sh.com.au)
Date: Sun Jan 29 2006 - 17:58:44 EST

  • Next message: Andrus Adamchik: "Re: 3t and performance"

    Hello !
    I would like to ask about paging in cayenne 3t. From what I see it
    doesn't work, is it possible to implement this feature ?

    Another thing is caching. I'm creating a shared context:

         public static CayenneContext getSharedContext() {
             if (sharedContext == null) {
                 //create the sharedContext
                 logger.info("#### Creating new connection to : " + URL);
                 try {
                    OPPConnection connection = new HessianConnection(
                             URL,
                             ClientID,
                             ClientPass,
                             "shared-session");
                    
                     // enable channel events
                     OPPServerChannel channel = new OPPServerChannel
    (connection, true);

                     // trace ALL context local and remote events ...
    must keep references to listeners
                     // to avoid deallocation
                     EventTrace contextTrace = new EventTrace("context-
    event");
                     EventTrace channelTrace = new EventTrace("channel-
    event");
                     ObjectContextUtils.listenForContextEvents(channel,
    contextTrace);
                     ObjectContextUtils.listenForChannelEvents
    (channel.getEventManager(), channelTrace);

                     // enable graph events
                     sharedContext = new CayenneContext(channel, true,
    true);
                 } catch (org.objectstyle.cayenne.CayenneRuntimeException
    ex) {
                     logger.error(ex);
                 }
             }
             return sharedContext;
         }

    then if I create a query like this :
                     SelectQuery qual = new SelectQuery(persistentClass);
                      qual.setCachePolicy(GenericSelectQuery.LOCAL_CACHE); //tried
    GenericSelectQuery.SHARED_CACHE - no difference
                        qual.setPageSize(50);
                        List recordList = getSharedContext().performQuery(qual);

    to fetch 65.000 records. Memory usage on server hits 200Mb, but its
    fine. Copying records to client takes aprox. 30 secods, but all this
    issues could be fixed with paging. When I then repeat this query I
    can see server sending a query to the database, and memory usage on
    server hits 400Mb -> is that all right ? I would imagine that if the
    records are cached on server there is no need to re-fetching them, so
    I think there could be some problem with caching or with my code.
    What am I doing wrong ?

    Regards
    Marcin



    This archive was generated by hypermail 2.0.0 : Sun Jan 29 2006 - 17:58:58 EST