ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Rasmussen <kristapes...@yahoo.com>
Subject lazy-loading=off problems
Date Sun, 06 Feb 2005 07:23:04 GMT
I have table with a parent child relationship. I have been trying to figure out why so many
database calls are being made because it appears that there are more than there should each
time a web page loads. I tryed turning off lazy-loading because I thought it might not be
working, but when i did I quickly overflowed the stack and the number of sql queries went
from about 19 to 600.
If my table only has 6 rows in it and there are definatly no loops in the paret child relationships
then I don't know how this many queries could be possible.
Any ideas what is going on?
Here is my code...
<resultMap id="getPageResult" class="page">
<result property="siteId" column="page.SiteId"/>
<result property="pageId" column="page.PageId"/>
<result property="parentPageId" column="page.ParentPageId"/>
<result property="title" column="page.Title"/>
<result property="subPages" column="{siteId=page.siteId,pageId=page.PageId}" select="getPagesByParentId"/>
<result property="parentPage" column="{siteId=page.siteId,pageId=page.ParentPageId}" select="getPage"/>
</resultMap>
 
 
<select id="getPagesByParentId" resultMap="getPageResult">
SELECT page.* FROM page WHERE page.SiteId = #siteId# AND page.ParentPageId = #pageId# ORDER
BY page.DisplayOrder
</select>

<select id="getPage"  resultMap="getPageResult">
SELECT page.* FROM page WHERE SiteId=#siteId# AND PageId=#pageId#
</select>
 

		
---------------------------------
Do you Yahoo!?
 All your favorites on one personal page  Try My Yahoo!
Mime
View raw message