Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 68502 invoked from network); 19 Mar 2010 18:25:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Mar 2010 18:25:09 -0000 Received: (qmail 70653 invoked by uid 500); 19 Mar 2010 18:25:09 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 70630 invoked by uid 500); 19 Mar 2010 18:25:09 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 70622 invoked by uid 99); 19 Mar 2010 18:25:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Mar 2010 18:25:09 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of catalina.wei@gmail.com designates 209.85.211.193 as permitted sender) Received: from [209.85.211.193] (HELO mail-yw0-f193.google.com) (209.85.211.193) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Mar 2010 18:25:01 +0000 Received: by ywh31 with SMTP id 31so1762823ywh.25 for ; Fri, 19 Mar 2010 11:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=K0fNov74mVMKhPuscJi+MpvypZrW/egPKiehF4uca00=; b=UXiUiZvw91bZ6UOV8kO9NbqgRZgpZRpx4aN9RUmbNzdZ+nLP0D3a/zhVwSmoSbDqmy A/WJmvVL93nbIPSB8qdZYg/6iQcEy+YZzwAy7Xl/QWaaoajFcthBGubPbEehWxexgkbx ZFEjZUZfSlsGby4F8Fxk3bjTtbP8QEnG4sSng= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aNydpcNdWu1jdwm3BQBK6c93bwfL+xDCE2GsfDjTRuXWoxJk7lDsGbL22+58VIOLcl DRGTzK8HERrU6rdB3HM+SyG0aXI9f0eHbWX/lvaSU9DwxAJFNV8OOBnBU3FJI5AChQ9x JB8Ov66GNiQjGcOUVVc54U6yjeHYwBKFbOaTU= MIME-Version: 1.0 Received: by 10.101.125.4 with SMTP id c4mr7827197ann.225.1269023079264; Fri, 19 Mar 2010 11:24:39 -0700 (PDT) In-Reply-To: <8e68c8e91003182027t5af01a18s5d6675b4dd288907@mail.gmail.com> References: <796206152.356221268967087210.JavaMail.jira@brutus.apache.org> <1779213565.356291268967687748.JavaMail.jira@brutus.apache.org> <8e68c8e91003182027t5af01a18s5d6675b4dd288907@mail.gmail.com> Date: Fri, 19 Mar 2010 11:24:37 -0700 Message-ID: Subject: Re: [jira] Updated: (OPENJPA-1585) Additional trace to relate SQL pushdowns with entity action or JPQL query From: catalina wei To: dev@openjpa.apache.org Content-Type: multipart/alternative; boundary=001636ed6bdada396c04822b75ca X-Virus-Checked: Checked by ClamAV on apache.org --001636ed6bdada396c04822b75ca Content-Type: text/plain; charset=ISO-8859-1 Hi Albert, thanks for your input. I will auto-enable SQL trace when this trace is enabled. BTW, I am changing the the name 'Extra' to 'DIAG'. If you there no objections, I will commit the patch. Catalina On Thu, Mar 18, 2010 at 8:27 PM, Albert Lee wrote: > >> It would only make sense to turn on Extra trace when Query and SQL > traces > are also turned on. > > Shouldn't we automatically enable the SQL log at the same level as Extra if > it is specified alone. > > Albert Lee. > > On Thu, Mar 18, 2010 at 10:01 PM, Catalina Wei (JIRA) >wrote: > > > > > [ > > > https://issues.apache.org/jira/browse/OPENJPA-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel > ] > > > > Catalina Wei updated OPENJPA-1585: > > ---------------------------------- > > > > Attachment: OPENJPA-1585.patch > > > > In this patch, a trace channel named 'openjpa.jdbc.Extra' is defined for > > getting additional trace information that may help users relate the SQLs > > generated to entity activities or JPQL queries. > > > > To turn on this trace, add as below: > > > > value="Query=TRACE,SQL=TRACE,Extra=TRACE"/> > > > > It would only make sense to turn on Extra trace when Query and SQL traces > > are also turned on. > > > > > Additional trace to relate SQL pushdowns with entity action or JPQL > query > > > > ------------------------------------------------------------------------- > > > > > > Key: OPENJPA-1585 > > > URL: > https://issues.apache.org/jira/browse/OPENJPA-1585 > > > Project: OpenJPA > > > Issue Type: Improvement > > > Affects Versions: 2.0.0 > > > Reporter: Catalina Wei > > > Assignee: Catalina Wei > > > Priority: Trivial > > > Attachments: OPENJPA-1585.patch > > > > > > > > > Additional trace can help users understand and relate query or entity > > actions with SQL pushdowns: > > > 1. why SQL pushdown has JOINs that are generated, a trace dumping out > > eager relations for the generated SQL is very helpful. > > > 2. a JPQL or a simple em.find() generated caused more than one SQL > > requests. > > > 3. entity instance actions (INSERT, UPDATE, DELETE) generated SQL > > > Examples: > > > 1. JOIN is generated because of the eager relation 'entitya': > > > 4891 p1 TRACE [main] openjpa.Query - Executing query: select s from > > CascadeB s > > > 4906 p1 TRACE [main] openjpa.jdbc.Extra - Eager relations: > > [test.entities.CascadeB.entitya] > > > 5141 p1 TRACE [main] openjpa.jdbc.SQL - > > executing prepstmnt 25862088 SELECT t0.id, t1.id, t1.name, t0.name FROM > > CascadeB t0 LEFT OUTER JOIN CascadeA t1 ON t0.ENTITYA_ID = t1.id > > > 2. flush for new instance of entity action: > > > 7250 p1 TRACE [main] openjpa.jdbc.Extra - flush: > > org.apache.openjpa.kernel.PNewState for oid=1 > > > 7250 p1 TRACE [main] openjpa.jdbc.SQL -: INSERT INTO BasicA > > (age,id,name) VALUES (?,?,?) [1,1,name1] > > > 2: loading relation 'entitya': > > > 7734 p1 TRACE [main] openjpa.jdbc.Extra - load field: 'entitya' for > > oid=1 class test.entities.BasicB > > > 7734 p1 TRACE [main] openjpa.jdbc.Extra - find: oid=1 class > > test.entities.BasicA > > > 7734 p1 TRACE [main] openjpa.jdbc.Extra - getInitializeStateResult: > > oid=1 class test.entities.BasicA > > > 7969 pdq1 TRACE [main] openjpa.jdbc.SQL - > > executing prepstmnt 28008463 SELECT t0.name FROM BasicA t0 WHERE t0.id = > ? > > optimize for 1 row [params=(int) 1] > > > > -- > > This message is automatically generated by JIRA. > > - > > You can reply to this email to add a comment to the issue online. > > > > > > > -- > Albert Lee. > --001636ed6bdada396c04822b75ca--