-->
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: How to set blob size?
PostPosted: Thu Feb 15, 2007 4:01 pm 
Beginner
Beginner

Joined: Sat Jul 08, 2006 2:58 pm
Posts: 26
I am trying to store a blob in my database. In my class file I declared it as follows;


Code:
private Blob file;



Code:
    /**
     * @hibernate.property
     * column="file"
     */
   public Blob getFile() {
      return file;
   }

   public void setFile(Blob file) {
      this.file = file;
   }



This seems to work for files less than 5MB but I get the following error for files larger than that.


Code:
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [com.chisq.common.bo.Document]; uncategorized SQLException for SQL [insert into Document (documentDate, DocumentTypeID, documentTitle, documentSubject, documentHyperlink, documentComment, documentVersion, filename, file, documentSize, mimeType) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [01004]; error code [0]; Data truncation: Data too long for column 'file' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'file' at row 1


Has anyone else run into this problem? What would you recomment should I do?

Thanks,
-Joe


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 15, 2007 5:21 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I would ask in the user forum, not the tools forum.

_________________
Max
Don't forget to rate


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.