ProcedureQuery Hint

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Jan 17 2005 - 22:19:28 EST

  • Next message: Andrus Adamchik: "Re: invalid packet type, DefaultResultIterator"

    Just noticed that Cayenne behaves somewhat differently when executing
    ProcedureQuery in two seemingly equivalent situations:

    (1) ProcedureQuery q = new ProcedureQuery("ProcName");
         context.performQuery(q);

    (2) Procedure procedure =
    context.getEntityResolver().lookupProcedure("ProcName");
         ProcedureQuery q = new ProcedureQuery(procedure);
         context.performQuery(q);

    The end result is of course the same, but case (1) incurs extra
    overhead when EntityResolver is asked to find a DataMap that handles
    query "root". To make the long story short, String root causes
    reindexing of EntityResolver on every call, while Procedure root does
    not, so case (2) is faster (or maybe significantly faster if you have a
    big DataMap that takes a while to reindex).

    I'll add this finding to JavaDocs.

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Jan 17 2005 - 22:19:35 EST