openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Johnson <apa...@spatula.net>
Subject Re: Issues with FetchType.LAZY for Lob fields
Date Tue, 20 Nov 2007 03:31:36 GMT
Just in general, I've had similar behaviour to that happen if I 
inadvertently closed the EntityManager that I had used to grab the Entity 
before reading the lazy-loaded field.

   Nick

On Mon, 19 Nov 2007, Gul Onural wrote:

> 
> I have a @Lob member variable in one of my Entities. If I annotate the
> field fetch=FetchType.LAZY
> and try to get its value using variable's get method, I always get null.
> 
> However, if I change the fetch to be EAGER (without any other change in
> the entire code), I get the value I supposed to get.
> 
> Is there a known issue w.r.t the LAZY fetch type in general or am I
> missing something simple?
> 
> 
> @Lob
> @Basic(fetch = FetchType.LAZY)
> private String address;
> 
> public String getAddress() {
>    return this.address;
> }
> 

-- 
"Courage isn't just a matter of not being frightened, you know. It's being
 afraid and doing what you have to do anyway."
   Doctor Who - Planet of the Daleks
This message has been brought to you by Nick Johnson 2.3b1 and the number 6.
http://healerNick.com/       http://morons.org/        http://spatula.net/

Mime
View raw message