-->
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.  [ 1 post ] 
Author Message
 Post subject: Only 1 byte of blob getting saved
PostPosted: Wed Mar 09, 2005 2:54 pm 
Newbie

Joined: Wed Mar 09, 2005 2:49 pm
Posts: 2
Hi:
I am using Hibernate 2.1 with Oracle 8i. I am using following code to save blobs.

childData.setFullAnswer(Hibernate.createBlob(" ".getBytes()));
//end blob code
serviceImpl.getSession().saveOrUpdateCopy(childData);
//blob code
serviceImpl.getSession().flush();
serviceImpl.getSession().refresh(childData, LockMode.UPGRADE);
BLOB blob = (BLOB)childData.getFullAnswer();
OutputStream os = null;
try
{
os = blob.getBinaryOutputStream();
}
catch (SQLException e)
{
e.printStackTrace();
}
if (os != null) {
byte[] b = childData.getAnswer().getBytes();
if (childData.getAnswer() != null) os.write(b); else os.write(null);
os.flush();
os.close();
}

When I check in database, only 1 byte is saved. There is no exception or error. Your help will be sincerely appreciated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.