-->
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.  [ 3 posts ] 
Author Message
 Post subject: Lazy blob is eagerly fetched
PostPosted: Mon Apr 03, 2006 11:10 pm 
Newbie

Joined: Mon Apr 03, 2006 10:44 pm
Posts: 2
I have a blob which I want to be fetched lazily however the sql logging shows that it is being fetched in one go with the other attributes.

Code:
    /**
     * The actual data for the attachment.
     */
    @Lob
    @Basic(fetch = FetchType.LAZY)
    @Column(name = "DATA")
    private Blob data;


Should this work as I expect? This was tested with an in-memory hsqldb but it will eventually be used to store very large files in mysql.

Versions:
- hibernate 3.2.0-cr1
- hibernate-annotations 3.1beta9
- hibernate-entitymanager 3.1beta7

cheers


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 03, 2006 11:19 pm 
Beginner
Beginner

Joined: Mon Sep 15, 2003 6:28 pm
Posts: 26
I just wanted to inject a comment that may save you some time later:

If you're working with Blobs, you'll solve a lot of problems by making the field lazy loaded. The bytecode instrumentation is easy to set up. In particular, you'll find that you can now cache the blob-containing entity.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 04, 2006 4:19 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Plus a Log is lazy as per the JDBC spec (read the Javadoc)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.