-->
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.  [ 5 posts ] 
Author Message
 Post subject: Lazy load byte[]
PostPosted: Tue Jun 20, 2006 3:09 pm 
Beginner
Beginner

Joined: Tue Jun 21, 2005 1:36 am
Posts: 29
Location: Houston, TX
I am using byte[] properties for binary objects as follows in PostgreSQL

Code:
   private byte[] file;
   @Basic(fetch=FetchType.LAZY)
   public byte[] getFile() { return file; }
   public void setFile(byte[] file) { this.file = file; }


I added the lazy fetch type when I started to see performace problems because this field is being included in the select, but this seems to be ignored.

Any advice would be greatly appreciated.

_________________
Thank you for your time,

Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com
HJBUG Founder and President
http://www.hjbug.com


Top
 Profile  
 
 Post subject: why dont u store file on server
PostPosted: Tue Jun 20, 2006 3:22 pm 
Newbie

Joined: Wed Apr 26, 2006 2:43 pm
Posts: 6
Location: Bangalore
hi

why dont u store file on server itself . u just need to store its location in DB(i.e the relative path of file).


and yaa in mapping if u dont specify byte array as a blob than hibernate will treat that as tiny blob and u will get serialization exception. but in my opinion best way is store file on Server and store its location in database.


Regards
Arpit


Top
 Profile  
 
 Post subject: Managabilty and Sharing problems
PostPosted: Tue Jun 20, 2006 3:27 pm 
Beginner
Beginner

Joined: Tue Jun 21, 2005 1:36 am
Posts: 29
Location: Houston, TX
1. If I delete this row the file is automatically deleted.
2. If I back up the database this is automatically backed up.
3. If this is stored in the DB multible jboss instances can share this data.
4. Security is left to the db not the filesystem.

_________________
Thank you for your time,

Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com
HJBUG Founder and President
http://www.hjbug.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 16, 2006 2:02 pm 
Newbie

Joined: Wed Jul 26, 2006 11:06 am
Posts: 11
go here for the answer.

http://forum.hibernate.org/viewtopic.php?t=962140


Last edited by c_eric_ray on Thu Aug 17, 2006 10:06 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 17, 2006 9:38 am 
Newbie

Joined: Wed Jul 26, 2006 11:06 am
Posts: 11
See the bottom of this post for a few more details.

http://forum.hibernate.org/viewtopic.php?t=963507


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.