ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Gray" <jg...@siberra.com>
Subject LazyLoadProxyFactory bug? Ignores listClass during attempt to build proxy
Date Tue, 09 May 2006 23:32:36 GMT
I think I may have found a bug in the more recent LazyLoadProxyFactory.
If the list type in the domain object implements IList and a listClass
is specified in the sql map, ibatis ignores the list class setting and
instead attempts to build a proxy for the list type defined in the
domain object. In our case, the domain objects for which we have been
lazy loading properties have had their exposed types set to IList (so
that we could trade off custom collections against lazy-loaded lists
just by changing the config) but the sql map has been set to use the
custom collection. Older versions of ibatis would ignore the lazyload
attribute when a listclass was present, but with the new
proxy-generating codebase, it reverses this, obeying the lazyload but
ignoring the listclass and trying to instead proxy the IList (which of
course fails).

 

The fix, based on my limited testing today, is quite simple, involving a
one line change from this (currently on line 95):

 

proxy =
ProxyGeneratorFactory.GetProxyGenerator().CreateClassProxy(typeProxified
, handler, Type.EmptyTypes);

 

to this:

 

proxy =
ProxyGeneratorFactory.GetProxyGenerator().CreateClassProxy(mappedStateme
nt.Statement.ListClass, handler, Type.EmptyTypes);

 

 

 

Jeremy Gray
Development Lead, SIMM Services
siberra
DIGITAL MEDIA SYSTEMS
Tel:  604-696-3230
jgray@siberra.com <mailto:jgray@siberra.com> 
www.siberra.com <http://www.siberra.com/>  

 


Mime
View raw message