Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 51497 invoked from network); 15 Oct 2004 17:42:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Oct 2004 17:42:25 -0000 Received: (qmail 32248 invoked by uid 500); 15 Oct 2004 17:42:21 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 32107 invoked by uid 500); 15 Oct 2004 17:42:20 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 32075 invoked by uid 99); 15 Oct 2004 17:42:19 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of xuhua.lin@gmail.com designates 64.233.170.198 as permitted sender) Received: from [64.233.170.198] (HELO mproxy.gmail.com) (64.233.170.198) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 15 Oct 2004 10:42:19 -0700 DomainKey-Signature: a=rsa-sha1; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=oeRo9NPGGhKNYwqWqac2z+14qzcdUJYURXd4qBukLaVvVDt3UvTlSqlVPR+VghLFM6oCWXbsaT+Xvlh8bLI+vG974X1PzRTYeAOPxx+i2bSoBUZZUmTFCnMnZbsGYcOTkVeVyl0/YLNnsRN8/wX/WPPY+cDR4eLEgZNR65uJyK0 Received: by mproxy.gmail.com with SMTP id 79so70910rnl for ; Fri, 15 Oct 2004 10:42:14 -0700 (PDT) Received: by 10.38.78.34 with SMTP id a34mr18662rnb; Fri, 15 Oct 2004 10:41:43 -0700 (PDT) Received: by 10.38.164.71 with HTTP; Fri, 15 Oct 2004 10:41:42 -0700 (PDT) Message-ID: <37d34e6b041015104130be9a52@mail.gmail.com> Date: Fri, 15 Oct 2004 13:41:42 -0400 From: Howard Lin Reply-To: Howard Lin To: Apache Torque Users List Subject: Re: Back to back save is slow In-Reply-To: <1592218F4C3EED4FBEAC48F9160FE60F1182CE65@nycexmb09.pfizer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1592218F4C3EED4FBEAC48F9160FE60F1182CE65@nycexmb09.pfizer.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N One alternative is to use JDBC batch insert/update to reduce trips to database. You have to build your own prepared statement for this, though. (not Torque) Howard On Fri, 15 Oct 2004 12:58:55 -0400, Husek, Paul wrote: > Hello fellow Torquers, > > I like how Torque allows you to retrieve a list of Torque objects with a > single select. That's great! I'm looking for something similar for save() > > I'm doing some profiling on my application and see that a lot of time is > being used in the part of code where I save about 1000 Torque objects back > to the database; they are all the same type. Right now the code is > essentially a for loop doing a save() on each object. I'm wondering if > there is a way to speed this up, by effectively passing an array of objects > to be saved in a single method and allowing the Torque engine to only do a > single prepare. > > Instead of > > for (int i=0;i > Book book=(Book)books[i]; > > book.save(); > > } > > The save method is taking up the vast majority of the time in this loop of > course. > > Maybe something like BookPeer.save(books); > > Is there any method like this or any easy way to accomplish what I'm looking > for? > > Thanks much! > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org