ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Schindl <tom.schi...@bestsolution.at>
Subject Re: Problem with blob
Date Tue, 14 Aug 2007 11:44:59 GMT
Vanessa schrieb:
> I just uploaded my previous project (not Ibatis) and there it works 
> fine. Then I uploaded my new work (Ibatis). I only have rewritten it to 
> Ibatis, the other code is the same, end it gives me back the ERROR 500 
> just for the blobs that are stockade with length 59056 in the database. 
> This is the code where I get an error. And in my previous code this code 
> gives now error.
> 
> Bold = error
> 
> byteread = datasender.byteread;
> Charset charset = Charset.forName("UTF-8");
> CharsetDecoder decoder = charset.newDecoder();
> decoder.reset();
> ByteBuffer bb = ByteBuffer.allocate(65000);
> *bb.put(byteread, 0, 65000); *

Yes how long is byteread array? I suppose it is has a length of 59056 
this is why you get an Exception as it is described in the JavaDoc.

The line has to be:
---------8<---------
bb.put(byteread, 0, byteread.length);
---------8<---------

But this is a Java question and not an IBatis problem you code is simply 
buggy :-) I don't know why it worked in your old code but maybe you 
populated your byte-array always to a size of 65000 and:

a) you have been holding garbage in your array
b) you the last entries in the error had a value of 0 you haven't 
noticed because the keyvalue zero is a special char.

Tom

Mime
View raw message