ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harvey Kim" <cash...@fastmail.fm>
Subject ibatis eating up memory
Date Fri, 14 Sep 2007 20:47:18 GMT
There seems to be a problem using "queryWithRowHandler" when the
resulting object returned contains a collection that requires a groupBy


  <resultMap id="blahMap" class="blahObject" >
      <result property="xxxxx" column="XXXXXXX"/>
      <result property="internalList" resultMap="blah.blahOtherMap"/>

  <resultMap id="blahOtherMap" groupBy="someId" class="someObject" >
      <result property="abc" column="ABC"/>
      <result property="zzz" column="ZZZ"/>

getList  SELECT
    FROM PNL table 
    LEFT JOIN join_table jtable
    ON (table.abc = join_table.abc)

Java code:

sqlMapClient.queryWithRowHandler("getList", someObject,

rowHandlerObject's "handleRow".

  public void handleRow (Object valueObject)
      Runtime r = Runtime.getRuntime(); 
      if (rowCount++ % 10000 == 0)
        System.out.println("total memory and free memory is: " +
        r.totalMemory() + " : " + r.freeMemory());   
    catch (Exception e) 

As soon as I change "internalList" above to "internalObject" and get rid
of the groupBy, this thing can run forever.  If it stays as a list with
the "groupBy", the memory runs out really fast.

Any help will be appreciated.  If there is no solution soon, I will have
to resort to going back to using JDBC - which I've already implemented
and is working fine.

Thank You,


http://www.fastmail.fm - Does exactly what it says on the tin

View raw message