Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 52360 invoked from network); 14 Sep 2009 19:48:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Sep 2009 19:48:15 -0000 Received: (qmail 59730 invoked by uid 500); 14 Sep 2009 19:48:14 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 59701 invoked by uid 500); 14 Sep 2009 19:48:13 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 59693 invoked by uid 99); 14 Sep 2009 19:48:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 19:48:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 19:48:04 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MnHWZ-0001C8-BW for user-java@ibatis.apache.org; Mon, 14 Sep 2009 12:47:43 -0700 Message-ID: <25442025.post@talk.nabble.com> Date: Mon, 14 Sep 2009 12:47:43 -0700 (PDT) From: "K. Arnold" To: user-java@ibatis.apache.org Subject: ResultHandler - OutOfMemory Exception MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: akarnold@comcast.net X-Virus-Checked: Checked by ClamAV on apache.org I am trying to iterate over a result set of 2million records, for a large bulk load and transformation into a new ODS. It appears that I am getting an OutOfMemoryException because the DefaultResultSetHandler is caching the object in the nestedResultObjects property. Is there some property I should set or statement/ method call I should be using that will allow me to process one line at a time and not have the nestedResultObjects store each object? My goal: * Grab a row * Send it to be processed * Once processed, move on to the next row. Note: Once a row is processed I no longer need a tie back to the object. I have included the custom ResultHandler, the unit test and the configuration file. Please let me know if you need other information. package com.primetherapeutics.benplanmgr.entity.rxclaim; import org.apache.ibatis.executor.result.ResultContext; import org.apache.ibatis.executor.result.ResultHandler; import org.apache.log4j.Logger; /** * @author kjarnold * */ public class GroupEligibilityResultHandler implements ResultHandler { Logger logger = Logger.getLogger(GroupEligibilityResultHandler.class); int count = 0; public void handleResult(ResultContext context) { if(context.getResultObject() != null) { count++; logger.debug(count); } //context.stop(); } public int getCount() { return count; } } @Test public void getGroupElibibilitiesByResultHandler() { Map parameterMap = new HashMap(); parameterMap.put("gelThruDate", "1090101"); parameterMap.put("addDate", "1090911"); parameterMap.put("chgDate", "1090911"); parameterMap.put("planDate", "1090101"); try { GroupEligibilityResultHandler handler = new GroupEligibilityResultHandler(); session.select("com.primetherapeutics.benplanmgr.entity.rxclaim.data.GroupEligibilityMapper.getGroupEligibilities", parameterMap, handler); logger.debug(handler.getCount()); } finally { session.close(); } } Here are my mapping files: -- View this message in context: http://www.nabble.com/ResultHandler---OutOfMemory-Exception-tp25442025p25442025.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org For additional commands, e-mail: user-java-help@ibatis.apache.org