From torque-user-return-6372-apmail-db-torque-user-archive=db.apache.org@db.apache.org Mon Aug 22 06:41:05 2005 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 6009 invoked from network); 22 Aug 2005 06:41:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Aug 2005 06:41:05 -0000 Received: (qmail 62519 invoked by uid 500); 22 Aug 2005 06:41:03 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 62476 invoked by uid 500); 22 Aug 2005 06:41:03 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 62460 invoked by uid 99); 22 Aug 2005 06:41:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Aug 2005 23:41:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [212.159.14.132] (HELO pih-relay05.plus.net) (212.159.14.132) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Aug 2005 23:41:20 -0700 Received: from [84.92.164.30] (helo=mainfella) by pih-relay05.plus.net with esmtp (Exim) id 1E75zL-0001YD-Dh for torque-user@db.apache.org; Mon, 22 Aug 2005 07:40:55 +0100 From: "John Dunne" To: "'Apache Torque Users List'" Subject: RE: multiple databases and doDelete Date: Mon, 22 Aug 2005 07:41:58 +0100 Message-ID: <000001c5a6e4$a0d40150$0200a8c0@mainfella> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 In-Reply-To: <20050821110449.A61412@minotaur.apache.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Thanks Thomas, I'll look into your suggestion today. Thanks again, John. -----Original Message----- From: Thomas Fischer [mailto:tfischer@apache.org] Sent: 21 August 2005 19:16 To: Apache Torque Users List Subject: Re: multiple databases and doDelete Hi, I can reproduce your behaviour. However, I would not call it a bug, rather an unsupported feature of Torque. The problem ist the following: If you use more than one database, Torque knows internally which objects belong to which database, and it also keeps a map of known tables for each database (the database map). One object can only belong to one database. When deleting, for some reason which is not totally clear to me at the moment, Torque needs to know whether a column you used in the criteria is a primary key. It does so looking at the database map for the database. So it appears that Invoices were compiled as belonging to db1, and if you want to delete an invoice from db2, it is not able to locate the invoices in the database map for db2 and thus throws a null pointer exception. I know no easy way how this can be changed at the moment. The problem is rooted deeply in the architecture of Torque. Perhaps someone else got an idea, now that the reason for the problem is known. Perhaps you can manipulate the database map manually in some way (though I'd call that not a solution but a hack) (this should be done best in a static initializer of the InvoicePeer class) Thomas On Fri, 19 Aug 2005, John Dunne wrote: > I'm of the thinking that this is a bug? I've been able to workaround the > problem by getting a java.sql.Connection directly to the database and issuing > delete statements via the connection's java.sql.Statement object (for those > who come across this problem in future). > > John. > > John Dunne wrote: > >> Hello all, >> >> Any help on this problem would be gratefully appreciated. >> >> Im getting a null pointer exception when I call doDelete (see code) >> >> Criteria crit = new Criteria(databasename); >> crit.add(InvoicesPeer.INVOICEID); >> InvoicesPeer.doDelete( crit); >> >> I've got two databases in MySQL (version 3) both with identical schemas. >> The default database is set to 'db1' and the exception is only thrown when >> databasename is set to 'db2'. The COM objects were compiled from a schema >> that identified the database name as 'db1' (so BaseInvoicesPeer has >> DATABASE_NAME='db1'; ), so i;m wondering if this is the problem, but then >> whats the point in specifing the database name to Critera! >> >> Further, I believe that Torque is configured proberly since I can query >> (doSelect) and retrieve the contents of both db1 and db2. This problem only >> occurs when I call doDelete! >> >> John. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >> For additional commands, e-mail: torque-user-help@db.apache.org >> >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org