-->
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: Strange exception "UnsupportedOperationException"
PostPosted: Sat Aug 20, 2005 5:35 pm 
Newbie

Joined: Thu Jul 07, 2005 1:47 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version::3.0.5
Name and version of the database you are using: Oracle 9i

Hi,

I have a very strange exception after loading a table and using one of the fields which is a blob. Blobs in my application are byte[]. So I try to copy/convert the loaded blob (that I have read) to byte[] and then I get the following exception:


java.lang.UnsupportedOperationException: Blob may not be manipulated from creating session


Can somebody help?

Thank you !

Regards,
KP


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 20, 2005 8:58 pm 
Newbie

Joined: Thu Aug 18, 2005 3:22 am
Posts: 13
I do not know why this is the case, but having a look at the source code shows, that the following methods of Hibernate's Blob implementation throw this exception:

public void truncate(long pos)
public byte[] getBytes(long pos, int len)
public int setBytes(long pos, byte[] bytes)
public int setBytes(long pos, byte[] bytes, int i, int j)
public long position(byte[] bytes, long pos)
public OutputStream setBinaryStream(long pos)
public long position(Blob blob, long pos)

Thus, the only way to get the bytes from the Blob seems to be the use of getBinaryStream().

Regards
Guido


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.