I'm using the latest from iBatis, which I compiled myself from svn last week. I'm using Spring 2.0 rc4 and I have both enhancementEnabled and lazyLoadingEnabled set to true, and I am experiencing no problems. Lazy loading is working as expected. Here's the snippet from my sql-map-config.
 
  <settings
    cacheModelsEnabled="true"
    errorTracingEnabled="true"
    enhancementEnabled="true"
    lazyLoadingEnabled="true"
    maxSessions="250"
    maxTransactions="30"
    maxRequests="500"
    useStatementNamespaces="true"/>


From: "Poitras Christian" <[EMAIL PROTECTED]> [mailto:"Poitras Christian" <[EMAIL PROTECTED]>]
Sent: Wednesday, September 27, 2006 7:55 AM
To: <[email protected]>
Subject: RE: lazy loading confusion

Hum... The requirements indicates that CGLIB 2.0 should be used. But I
doubt this would change anything.
I'm not using Spring, but if this sort of problem is normal with Spring,
the mailing list would already contain a solution.

Can anyone confirm that lazy loading works with Spring?

If so, then maybe it is the Spring configuration that is problematic.

Christian

-----Original Message-----
From: Tom Duffey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 27 September 2006 10:44
To: [email protected]
Subject: Re: lazy loading confusion


On Sep 27, 2006, at 9:40 AM, Poitras Christian wrote:

> Try to turn on enhancement (also add needed jar) for lazy loading and
> see what happens.

Same thing. I'm using CGLIB 2.1 which was the oldest version I could
find on their site.

Tom

> -----Original Message-----
> From: Tom Duffey [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 27 September 2006 10:34
> To: [email protected]
> Subject: Re: lazy loading confusion
>
>
> On Sep 27, 2006, at 9:28 AM, Poitras Christian wrote:
>
>> Maybe your application is accessing the "members" property when the
>> object is populating.
>>
>> Try to turn on logging and see what happens. Add a log statement in
>> your "members" property getter to be sure.
>
> Did this. The getter is never called, only the setter. This
> application is using Spring 1.x for some AOP logging, could it be
> manipulating some bytecode somehow to make iBATIS think it needs to
> load the data?
>
> Tom
>
>>
>> Christian
>>
>> -----Original Message-----
>> From: Tom Duffey [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, 27 September 2006 09:25
>> To: [email protected]
>> Subject: Re: lazy loading confusion
>>
>>
>> On Sep 27, 2006, at 1:41 AM, Niels Beekman wrote:
>>
>>> Can we see your config?
>>
>> What all would you like to see? It's a large application and the
>> example I posted is just a snippet. Here's more from my sql config
>> and dao config:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

>>

>>
>>
>>
>> etc.
>>

>>
>>
>>
>>
>>
>>
>>

>>
>> >> interface="org.projectFoundry.persistence.project.ProjectDao"
>> implementation="org.projectFoundry.persistence.project.ProjectSqlMapD
>> a
>> o"
>>
>> />
>> >> implementation="org.projectFoundry.persistence.user.UserSqlMapDao"/>
>> etc.
>>

>>

>>
>> Tom
>>
>>>
>>> -----Original Message-----
>>> From: Tom Duffey [mailto:[EMAIL PROTECTED]
>>> Sent: woensdag 27 september 2006 7:34
>>> To: [email protected]
>>> Subject: lazy loading confusion
>>>
>>> Hi All,
>>>
>>> I have a Project class with a list of Members. It is my
>>> understanding
>>
>>> that I can turn on lazy loading in my sql map config, define a
>>> Project
>>
>>> result map like:
>>>
>>>
>>>
>>> >>> select="Member.listByProject"/>
>>>

>>>
>>> and then retrieve a project and the members will not be retrieved
>>> unless I call getMembers() on the project instance. Is this how
>>> it's
>
>>> supposed to work? What I'm finding is that the members list is
>>> populated even if I do not call getMembers(). To back this idea I
>>> renamed the property in the result map to "members2" and added a new
>>> members2 attribute to the project class (To make sure I didn't miss
>>> any calls to getMembers) and sure enough it is still populated when
>>> I
>
>>> retrieve the project.
>>>
>>> What gives? I thought the point of lazy loading was to not load
>>> data
>
>>> unless I ask for it. I'm using iBATIS 2.1.7 for Java.
>>>
>>> Best Regards,
>>>
>>> Tom Duffey
>>
>>
>
>



Reply via email to