From open-jpa-dev-return-3535-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Tue Apr 17 22:16:45 2007 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 46111 invoked from network); 17 Apr 2007 22:16:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Apr 2007 22:16:44 -0000 Received: (qmail 84350 invoked by uid 500); 17 Apr 2007 22:16:50 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 84325 invoked by uid 500); 17 Apr 2007 22:16:50 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 84315 invoked by uid 99); 17 Apr 2007 22:16:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2007 15:16:50 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of eljotpl@gmail.com designates 64.233.184.226 as permitted sender) Received: from [64.233.184.226] (HELO wr-out-0506.google.com) (64.233.184.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2007 15:16:43 -0700 Received: by wr-out-0506.google.com with SMTP id i31so2046246wra for ; Tue, 17 Apr 2007 15:16:22 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=hm9fFT26yYO5qoJK8kuGBj1uuDufXkJg3hGF3paqydQa6mE7vdSt+mtA+jj3uJXfM5mzwJtikMvXx/lsXrz/UAbM8LmIHq7gSoTbA6NFZBAta/0mZmM0EOzUuw6fzeaYn13DCFMkRLcgguX+wD5HeBwy1Xpb5ngiCa/rJe6phK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=k+jxmaRYh989txA6sA7OnGmHy7Vxx01y7NlJz4faBv94rWP/BrgWCIgXjt5AJDPVHOjmojNoyXsnA6BxiGZfR5KsNdkI773rsSTHnR7YESZlYkTmVAEfBh/7DS8M4JRQr5RbZbpitJ1a+51PHn+w7k5QnoXT7ce8oYKukUAv7Ok= Received: by 10.114.155.1 with SMTP id c1mr2626546wae.1176848181328; Tue, 17 Apr 2007 15:16:21 -0700 (PDT) Received: by 10.114.193.10 with HTTP; Tue, 17 Apr 2007 15:16:21 -0700 (PDT) Message-ID: <1b5bfeb50704171516q1691a1b4ibf2ff01bf6e5af76@mail.gmail.com> Date: Wed, 18 Apr 2007 00:16:21 +0200 From: "Jacek Laskowski" Reply-To: jacek@laskowski.net.pl Sender: eljotpl@gmail.com To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate query In-Reply-To: <1176838255.6067.32.camel@burns> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <007d01c7805b$0b0e3c10$6601a8c0@tyan2400> <1176751228.4913.25.camel@burns> <1b5bfeb50704161249s74f502b7o77180eeb8d3abcfc@mail.gmail.com> <1b5bfeb50704161327r7bf76e0ci18e770381326138e@mail.gmail.com> <1176838255.6067.32.camel@burns> X-Google-Sender-Auth: 5c4e5b684567cabf X-Virus-Checked: Checked by ClamAV on apache.org On 4/17/07, Hans J. Prueller wrote: > it took some time but finally I can send to the TRACE. As it is rather long > I'll paste it below. Additional information: Thanks for the information. It's helped me a lot to narrow down the issue. I think it's misconfiguration that causes it and I don't think that we could call it a bug, but some improvements in OpenJPA configuration of PUs would be welcome. I think that the first query parsing occurs because in Java EE environments a jpa container is supposed to find all managed persistence classes (see Chapter 6 Entity Packaging of the JPA spec). So, OpenJPA searches all the roots of persistence units and collect information on them. That's why you see the first message about the query. 1679 lbsims TRACE [RMI TCP Connection(7)-127.0.1.1] openjpa.MetaData - parsePersistentTypeNames() found [com.lbslogics.ims.model.PositionLog]. ... 2203 lbsims TRACE [RMI TCP Connection(7)-127.0.1.1] openjpa.MetaData - Parsing class "com.lbslogics.ims.model.PositionLog". ... 2546 lbsims TRACE [RMI TCP Connection(7)-127.0.1.1] openjpa.MetaData - Parsing query "PositionLog.byId". Then, since the persistence.xml file has com.lbslogics.ims.model.PositionLog in it, it parses the class again (it shouldn't, but that's what I could merely come up with how OpenJPA works). That's when the other message about the query pops up: 3123 lbsims TRACE [RMI TCP Connection(7)-127.0.1.1] openjpa.MetaData - Processing registered persistence-capable class "class com.lbslogics.ims.model.PositionLog". ... 3134 lbsims TRACE [RMI TCP Connection(7)-127.0.1.1] openjpa.MetaData - Parsing query "PositionLog.byId". 3135 lbsims WARN [RMI TCP Connection(7)-127.0.1.1] openjpa.MetaData - Found duplicate query "PositionLog.byId" in "class com.lbslogics.ims.model.PositionLog". Ignoring. To prevent the double parsing from occuring, remove the class element from the persistence.xml file and let OpenJPA find the classes (not recommended in Java EE env and mandatory in Java SE) or add element to the persistence.xml file to tell OpenJPA that listed classes only are to be managed (highly recommended). I think it should help avoiding the message - "openjpa.MetaData - Found duplicate query "PositionLog.byId" in "class com.lbslogics.ims.model.PositionLog". Ignoring." Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl