Re: Query and the cache

From: Andrus (andru..bjectstyle.org)
Date: Mon Aug 12 2002 - 23:04:41 EDT

  • Next message: JR Ruggentaler: "RE: Query and the cache"

    At 09:51 PM 8/12/2002 -0500, JR Ruggentaler wrote:
    >I was trying to create and register several objects with Cayenne before
    >calling commitChanges to optimize access to the database. During my object
    >creation I query Cayenne to see if the object I want to add already exist.
    >The query seems to be unable to return new uncommitted objects from
    >Cayenne's cache. Is this by design, an unimplemented future feature, or a
    >bug?

    This is by design. Queries always return fresh data from the database,
    ignoring uncommitted objects. Could you explain why you need that, we may
    think of a workaround?

    >How do I turn off Cayenne logging? I tried:
    >org.objectstyle.cayenne.conf.Configuration.setLogLevel(java.util.logging.Lev
    >el.OFF);

    Query logging is handled by the QueryLogger class, which is separate from
    Configuration logging. Here is a quick way to configure this.

    1. If you are using release 1.0a2 that is based on JSDK 1.4 logging API, go
    to JRE_HOME/lib and edit standard file called "logging.properties". Add the
    following line somewhere in the bottom:

    org.objectstyle.cayenne.access.QueryLogger.level = SEVERE

    2. This is already replaced by log4j API in the nightly builds (since
    yesterday nightly build Cayenne can be deployed with JDK 1.3, finally). So
    if you are using latest nightly build, create the file
    $HOME/.cayenne/cayenne-log.properties with the contents similar to this:

    # turn off logging
    log4j.rootLogger=WARN, A1
    log4j.appender.A1=org.apache.log4j.ConsoleAppender
    log4j.appender.A1.layout=org.apache.log4j.PatternLayout
    log4j.appender.A1.layout.ConversionPattern=[%-5p %c{1}] %m%n

    # turn on indiv. packages
    #log4j.logger.org.objectstyle.cayenne = DEBUG
    log4j.logger.org.objectstyle.cayenne.access = ERROR



    This archive was generated by hypermail 2.0.0 : Mon Aug 12 2002 - 23:04:35 EDT