-->
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: 2000 byte restriction while using Blob data type
PostPosted: Fri Mar 26, 2004 2:25 pm 
Newbie

Joined: Fri Mar 26, 2004 1:55 pm
Posts: 1
Hibernate Version: 2.1.2
Database: Oracle 9i

Mapping File: (Only two columns displayed)
<property name="State" column="STATE" type="int"/>
<property name="XmlBlobProcess" column="XMLFILE" type="blob" not-null="true"/>

The XMLFILE column in the database is a of Blob data type.
I have tried giving the type as "blob" and "java.sql.Blob" without success.

Problem:
There is a castor generated object and I do the following things:
1. Marshall the object using the castor marshall method into a output stream
2. Get the bytearray of the outstream and use this to build a BlobImpl object (The blobImpl here is imported from hibernate package)
3. Set this blobimpl object to the java.sql.Blob field in the Info object
4. Call hibernates update method to update the object in the database.

I am tracing the size of the BlobImpl while saving the object from the UI.
If the size of the BlobImpl is less that 2000 bytes, then updation into database is successful.

If the size of the BlobImpl is greater than 2000, then the XMLFILE column data is being set to NULL. Since there is a not-null constraint in the DB, I am getting a error.

If I again reduce the size of the object (by making some modification in UI) to less than 2000, I am able to save the object.

Please let me know the significance of this 2000 bytes, and why is the attribute in the info being set to null, when the size is greater than 2000 bytes.


Top
 Profile  
 
 Post subject: Re: 2000 byte restriction while using Blob data type
PostPosted: Fri Feb 11, 2011 3:11 am 
Newbie

Joined: Wed Feb 09, 2011 1:38 am
Posts: 1
Could please tell me which database you are using , if you are using Oracle the issue is with the jar and you should replace with the latest one which supports.


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.