-->
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.  [ 2 posts ] 
Author Message
 Post subject: Persiting files
PostPosted: Thu Nov 01, 2007 6:48 pm 
Newbie

Joined: Thu Nov 01, 2007 6:34 pm
Posts: 2
Hi all,
I have to persist some files attached to an object using hibernate with MySQL.
Can you tell me which is the best way to do it or point me into the right direction?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 02, 2007 7:42 am 
Regular
Regular

Joined: Tue Jan 03, 2006 9:20 am
Posts: 74
Several ways to do that:

1) store the entire file content in a BLOB field (or possibly a CLOB for files containing only text).
2) store the files on the filesystem somewhere and store the location the files are stored as a VARCHAR in the database.

the second is usually better performant, but of course more brittle as the database now depends on external resources for consistency.


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