From torque-dev-return-5116-apmail-db-torque-dev-archive=db.apache.org@db.apache.org Fri Mar 11 12:13:53 2005 Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 38358 invoked from network); 11 Mar 2005 12:13:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Mar 2005 12:13:53 -0000 Received: (qmail 12529 invoked by uid 500); 11 Mar 2005 12:13:52 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 12498 invoked by uid 500); 11 Mar 2005 12:13:52 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 12484 invoked by uid 99); 11 Mar 2005 12:13:51 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from pc7.tewisoft.TGZ-Ilmenau.de (HELO gate-mail.tewisoft.de) (194.94.251.54) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 11 Mar 2005 04:13:50 -0800 Received: from localhost (localhost [127.0.0.1]) by gate-mail.tewisoft.de (Postfix) with ESMTP id 199EF12E3B for ; Fri, 11 Mar 2005 13:13:50 +0100 (CET) Received: from gate-mail.tewisoft.de (localhost [127.0.0.1]) by localhost (AvMailGate-2.0.1.16) id 32499-0B85B8AB; Fri, 11 Mar 2005 13:13:50 +0100 Received: from mail.tewisoft.de (unknown [192.168.20.18]) by gate-mail.tewisoft.de (Postfix) with ESMTP id E8B877CA0 for ; Fri, 11 Mar 2005 13:13:49 +0100 (CET) Received: by mail.tewisoft.de (Postfix, from userid 65534) id 78DFE366FC; Fri, 11 Mar 2005 13:13:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.tewisoft.de (Postfix) with ESMTP id 9D8AF367DA; Fri, 11 Mar 2005 13:13:26 +0100 (CET) Received: from tewisoft.de (shell10.tewisoft.de [192.168.20.120]) by mail.tewisoft.de (Postfix) with ESMTP id 0BF273298D for ; Fri, 11 Mar 2005 13:13:24 +0100 (CET) Message-ID: <42318B64.2070806@tewisoft.de> Date: Fri, 11 Mar 2005 13:13:24 +0100 From: Thomas Vandahl User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: de-de, en-us MIME-Version: 1.0 To: Apache Torque Developers List Subject: BasePeer.doPSSelect with complex query fails. References: <2016430564.1110460635146.JavaMail.scarab@localhost> In-Reply-To: <2016430564.1110460635146.JavaMail.scarab@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS snapshot-20020531 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on mail.tewisoft.de X-Spam-Level: X-Spam-Status: No, score=-110.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, USER_IN_WHITELIST,USER_IN_WHITELIST_TO autolearn=ham version=3.0.2 X-AntiVirus: checked by AntiVir MailGate (version: 2.0.1.16; AVE: 6.30.0.5; VDF: 6.30.0.25; host: mail.tewisoft.de) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi folks, I was trying to use prepared statements in my application. My selects consist of joins over several tables and I thought this would help performance. Instead, I got a DataSetException which I could track down in the latest Village code. It says "This schema represents several tables." From a deeper look into the code I saw that this one could never work. Reason: When the QueryDataSet(ResultSet) constructor is used, selectString is null and fetchRecords() tries to create one for no apparent reason: ---8<--- if (selectString == null) { selectString = new StringBuffer (256); selectString.append ("SELECT "); selectString.append (schema().attributes()); selectString.append (" FROM "); selectString.append (schema().tableName()); } ---8<--- In this piece of needless code schema().tableName() is called which throws the abovementioned exception if more than one table is referenced in the ResultSet. So this stuff cannot work for selects including joins. Call for comments: - Can this be verified by anyone else? - Is fixing Village a good option? - Does anyone know a workaround which we can put into BasePeer? Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org