Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 60429 invoked from network); 10 Mar 2007 10:45:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Mar 2007 10:45:29 -0000 Received: (qmail 22755 invoked by uid 500); 10 Mar 2007 10:45:37 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 22724 invoked by uid 500); 10 Mar 2007 10:45:37 -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 22713 invoked by uid 99); 10 Mar 2007 10:45:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Mar 2007 02:45:37 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [62.13.136.10] (HELO outmail136010.authsmtp.co.uk) (62.13.136.10) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Mar 2007 02:45:25 -0800 Received: from outmail128179.authsmtp.co.uk (outmail128179.authsmtp.co.uk [62.13.128.179]) by punt3.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id l2AAj3Z4099390 for ; Sat, 10 Mar 2007 10:45:03 GMT Received: from [172.16.33.34] (p57AB1F36.dip0.t-ipconnect.de [87.171.31.54]) (authenticated bits=0) by mail.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id l2AAj04Y038875 for ; Sat, 10 Mar 2007 10:45:01 GMT Message-ID: <45F28C30.4030102@apache.org> Date: Sat, 10 Mar 2007 11:45:04 +0100 From: Thomas Vandahl User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: Apache Torque Users List Subject: Re: CriteriaEnumeration References: In-Reply-To: X-Enigmail-Version: 0.94.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Server-Quench: 661d6648-cef4-11db-8cc9-001185d377ca X-AuthRoute: OCdyaAgQClZJUiwT EioPDCIGTh8qMAFL GwYeIE5HO1cTfQhb dE9CJ1FTPRsbX15P AmYUJgUWT19xWWRl agpbaQBXYksAVwJ0 UU9IXFFTCgBsHh4E GR5QDhsDBl9GfBdw Zk5qWXUVXUNzcgh7 RE8AE2sCbXozPTYb TUFZI1FJeFAZdwJF alF+XHZZYmIANSsu JQJhdxsrPClSMiVc bwcQKF8ISFoKGThU X-Authentic-SMTP: 61633138303539.squirrel.dmpriest.net.uk:556/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Checked: Checked by ClamAV on apache.org Thoralf Rickert wrote: > Hi! > > I'm not sure, if this was discussed before, but I want to send you this > "extension". > > Currently I'm working on somekind of "backup-procedure" that reads some > data from a database and creates a complex XML file (for example: stores > with addresses and products). To do this, I have to get all "stores" > from the database. If there are a lot of stores and I make just a > doSelect(new Criteria()) I have (of course) trouble with the memory > (number of stores > 100000). > > I could implement a special algorithm, but I decided to implement a > mechanism that takes a Criteria and set offset/limit internally in a > loop. In this way I can get 100 stores with one SELECT and do my work. > If the "pool" is empty, I can read the next 100 stores. > This is more or less what LargeSelect does. I used to use it for such things - reading data one page at a time. It provides the additional advantage of a "read-ahead-cache", means it continues reading your data in the background while you can process the first page of records. If you are interested, I created a small LargeSelectHelper class which allows you to continuously read one page at a time and let LargeSelect do the "chunking". Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org