ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict" <pbened...@apache.org>
Subject Re: Odd behavior with CGLIB (lazy loading problem)
Date Wed, 24 Jan 2007 16:17:57 GMT
Basically speaking, the lazy-loading query is executing immediately, but the
data is somehow not being set. So I'll query for an "id" property, but the
data doesn't persist. If I remove the code from the constructor which
invokes a method, the data will persist. Go figure! I don't know why, and so
I hope Clinton will be able to help out: I sent him a simple example.

As to Larry's point, calling setters on a field defined on a class is kind
of ancillary. It doesn't have to be setters -- it could be any method. But
if you want to call setters, it is to allow defensive logic to run. Perhaps
you want assertions or other kind of parameter checks in your mutators.

Paul

On 1/24/07, Niels Beekman <n.beekman@wis.nl> wrote:
>
> We ran into this issue by trying to reuse parameter validation code. It
> can be worked around, but it's still something to be aware of (maybe on
> the Wiki?).
>
> Paul has a slightly different problem I think, since our method calls
> triggered lazy loading, while Paul cannot load the data at all, if I'm
> not mistaken.
>
> Niels
>

Mime
View raw message