ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject Lazy Loading not working
Date Fri, 25 May 2007 00:17:37 GMT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16441" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=776340600-25052007><FONT face=Arial size=2>I've got one
SQLMap 
for an object that has children. For some reason when I execute a select and 
have properties of the result object perform selects to retrieve the adjacent 
objects the lazy load does not seem to work, but rather the adjacent select 
statements are being fired and the data is retrieved.</FONT></SPAN></DIV>
<DIV><SPAN class=776340600-25052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=776340600-25052007><FONT face=Arial size=2>I'm using iBatis

2.3.0.667</FONT></SPAN></DIV>
<DIV><SPAN class=776340600-25052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=776340600-25052007><FONT face=Arial size=2>My SQL Map Config

has the following defined:</FONT></SPAN></DIV><SPAN class=776340600-25052007>
<DIV><BR><FONT face=Arial size=2>&nbsp;&lt;settings 
<BR>&nbsp;&nbsp;cacheModelsEnabled="true"<BR>&nbsp;&nbsp;errorTracingEnabled="true"

<BR>&nbsp;&nbsp;enhancementEnabled="true" 
<BR>&nbsp;&nbsp;lazyLoadingEnabled="true" <BR>&nbsp;&nbsp;maxSessions="250"

<BR>&nbsp;&nbsp;maxTransactions="30" <BR>&nbsp;&nbsp;maxRequests="500"

<BR>&nbsp;&nbsp;useStatementNamespaces="true"/&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=776340600-25052007><FONT face=Arial size=2>My result Map
looks 
as follows: (The ones in red seem to be fired every time no matter 
what)</FONT></SPAN></DIV>
<DIV><SPAN class=776340600-25052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=776340600-25052007><FONT face=Arial size=2>&nbsp; &lt;resultMap

id="MessageResult" class="Message"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;result

column="Message_id" jdbcType="NUMERIC" property="id"/&gt;<BR>&nbsp;&nbsp;&nbsp;

&lt;result column="Message_type" jdbcType="VARCHAR" 
property="type"/&gt;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;
&lt;result 
column="Message_state" jdbcType="VARCHAR" property="state" 
/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;result column="Message_previous_state"

jdbcType="VARCHAR" property="previousState" /&gt;<BR>&nbsp;&nbsp;&nbsp;

&lt;result column="Message_document_identifier" jdbcType="VARCHAR" 
property="documentIdentifier"/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;result

column="Message_purchase_order_no" jdbcType="VARCHAR" 
property="poNumber"/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;result 
column="Message_order_no" jdbcType="VARCHAR" property="order" 
select="RequestOrder.findByPrimaryKey"/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;result

column="Message_create_date" jdbcType="TIMESTAMP" property="createDate" 
/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;result column="Message_mod_date"

jdbcType="TIMESTAMP" property="modifiedDate" /&gt;<BR>&nbsp;&nbsp;&nbsp;

&lt;result column="Message_version" jdbcType="INTEGER" property="version" 
/&gt;<BR>&nbsp;&nbsp;&nbsp;<FONT color=#ff0000><STRONG>
&lt;result 
column="{textPointer=Payload_text_pointer,dataLength=Payload_data_length}" 
property="payload" select="Message.loadContent"/&gt;<BR>&nbsp;&nbsp;&nbsp;

&lt;result column="Message_parent_id" property="parent" 
select="Message.findByPrimaryKey"/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;result

column="Message_id" property="metaData" 
select="MessageMetaData.findByMessageId"/&gt;<BR></STRONG></FONT>&nbsp;

&lt;/resultMap&gt;<BR></FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=776340600-25052007>Thanks for the

help...</SPAN></FONT></DIV>
<DIV></SPAN>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV align=left><FONT face=Arial size=2>Chris Mathrusse</FONT></DIV>
<DIV align=left><FONT face=Arial size=2><A 
href="mailto:christopher.mathrusse@sybase.com">christopher.mathrusse@sybase.com</A></FONT></DIV>
<DIV align=left><FONT face=Arial size=2>(925) 236-5553</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>


Mime
View raw message