-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: Lazy Lob
PostPosted: Mon Jan 16, 2006 4:51 am 
Newbie

Joined: Mon Jan 16, 2006 4:33 am
Posts: 11
Hibernate version: 3.1

Hibernate Annotations version: 3.1-b7

Annotated code:
Code:
@Entity( access = AccessType.FIELD )
public class Dog extends DomainObject {
   ...
   @Lob( optional = true )
   @Column( length = 131071 )
   private byte[] image;
   ...
}


It's my understanding that the fetch type defaults to lazy for Lobs (http://www.hibernate.org/hib_docs/ejb3-api/javax/persistence/Lob.html). However, looking at the generated SQL, the image is being fetched eagerly. Is this because it's a byte array? Would it be lazy for a java.sql.Blob? Would it still be eager if I were using a byte array and AccessType.PROPERTY on the entity?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 7:17 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
In the next release, a LAZY Lob on enhanced class should do the trick.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 7:18 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I'm astonished the current one does not though

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 7:36 pm 
Newbie

Joined: Mon Jan 16, 2006 4:33 am
Posts: 11
emmanuel wrote:
In the next release, a LAZY Lob on enhanced class should do the trick.

Thanks. Is there an issue in JIRA that I can keep track of?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 10:09 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is already done in CVS

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 11:50 pm 
Newbie

Joined: Mon Jan 16, 2006 4:33 am
Posts: 11
OK, thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 20, 2006 9:25 pm 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
when will this (BLOB/CLOB lazy fetching) be available as release? I use a lot of BLOB for pictures. It is very slow because of fetching a lot of images from database.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 6:00 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
it is

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 8:59 pm 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
Is it available for download? thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 2:32 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
did you try to look at it?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 6:32 pm 
Newbie

Joined: Mon Jan 16, 2006 4:33 am
Posts: 11
javatwo - he's probably referring to annotations 3.1-beta8, which just came out


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.