ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject How to control Lazy Loading
Date Tue, 11 Sep 2007 00:07:22 GMT

<br><font size=2 face="sans-serif">I'm using iBatis 2.3.0 and I'm having
some issues with the Lazy Loading. It seems that several of my objects
which should be lazy loaded are actually getting loaded when nothing is
accessing the object. The SQL select statements are simply getting fired
when the parent object is loaded. I've looked at the objects being assigned
and they are indeed the loaded. Here is the print out of the variable being
assigned.</font>
<br>
<br><font size=2 face="sans-serif"><b>CGLIB$CALLBACK_0 &nbsp; &nbsp;
&nbsp;
&nbsp;EnhancedLazyResultLoader$EnhancedLazyResultLoaderImpl &nbsp;(id=316)
&nbsp; &nbsp; &nbsp; &nbsp;</b></font>
<br><font size=2 face="sans-serif"><b>&nbsp; &nbsp; &nbsp; &nbsp;
client
&nbsp; &nbsp; &nbsp; &nbsp;SqlMapClientImpl &nbsp;(id=321) &nbsp;
&nbsp; &nbsp; &nbsp;</b></font>
<br><font size=2 face="sans-serif"><b>&nbsp; &nbsp; &nbsp; &nbsp;
loaded
&nbsp; &nbsp; &nbsp; &nbsp;true &nbsp; &nbsp; &nbsp; &nbsp;</b></font>
<br><font size=2 face="sans-serif"><b>&nbsp; &nbsp; &nbsp; &nbsp;
parameterObject
&nbsp; &nbsp; &nbsp; &nbsp;&quot;1376771&quot; &nbsp; &nbsp;
&nbsp;
&nbsp;</b></font>
<br><font size=2 face="sans-serif"><b>&nbsp; &nbsp; &nbsp; &nbsp;
resultObject
&nbsp; &nbsp; &nbsp; &nbsp;RequestOrder &nbsp;(id=329) &nbsp; &nbsp;
&nbsp; &nbsp;</b></font>
<br><font size=2 face="sans-serif"><b>&nbsp; &nbsp; &nbsp; &nbsp;
statementName
&nbsp; &nbsp; &nbsp; &nbsp;&quot;RequestOrder.findByPrimaryKey&quot;
&nbsp; &nbsp; &nbsp; &nbsp;</b></font>
<br><font size=2 face="sans-serif"><b>&nbsp; &nbsp; &nbsp; &nbsp;
targetType
&nbsp; &nbsp; &nbsp; &nbsp;Class&lt;T&gt; (com.sybase.it.cosmos.domain.RequestOrder)
(id=310) &nbsp; &nbsp; &nbsp; &nbsp;</b></font>
<br>
<br><font size=2 face="Courier New">As you can see the object has been
loaded. Is there a way that I can control when these objects are loaded
and when they are not? Is there a way that I can log what is transpiring
to cause these objects to be loaded?</font>
<br>
<br><font size=2 face="Courier New">Here is my sql-map-config entry for
lazy loading.</font>
<br>
<br><font size=2 face="Courier New">&nbsp; </font><font size=2 color=#008080
face="Courier New">&lt;</font><font size=2 color=#3f8080 face="Courier New">settings
</font><font size=2 color=#800080 face="Courier New">cacheModelsEnabled</font><font
size=2 face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;false&quot;
</font><font size=2 color=#800080 face="Courier New">errorTracingEnabled</font><font
size=2 face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;false&quot;</font>
<br><font size=2 color=#4200ff face="Courier New">&nbsp; &nbsp; </font><font
size=2 color=#800080 face="Courier New">enhancementEnabled</font><font size=2
face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;true&quot;
</font><font size=2 color=#800080 face="Courier New">lazyLoadingEnabled</font><font
size=2 face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;true&quot;
</font><font size=2 color=#800080 face="Courier New">maxSessions</font><font
size=2 face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;250&quot;</font>
<br><font size=2 color=#4200ff face="Courier New">&nbsp; &nbsp; </font><font
size=2 color=#800080 face="Courier New">maxTransactions</font><font size=2 face="Courier
New">=</font><font size=2 color=#4200ff face="Courier New">&quot;30&quot;
</font><font size=2 color=#800080 face="Courier New">maxRequests</font><font
size=2 face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;500&quot;
</font><font size=2 color=#800080 face="Courier New">useStatementNamespaces</font><font
size=2 face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;true&quot;
</font><font size=2 color=#008080 face="Courier New">/&gt;</font>
<br>
<br>
<br><font size=2 face="sans-serif">Thanks for the help...</font>

Mime
View raw message