db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikael" <mikael-arons...@telia.com>
Subject Re: PreparedStatement problem with big BLOBS
Date Fri, 21 Sep 2007 17:42:54 GMT
Here is a modified version of the SimpleApp that comes with Derby, 
if you run it without any argument (embedded mode) it works just 
fine, but if you add the argument "derbyclient" to run it in client mode 
it throws the exception, the modified code is marked with comments
and look's like this:

   byte[] data = new byte[ 38000];
   ByteArrayInputStream is = new ByteArrayInputStream( data);   
   String sql = "UPDATE testing SET contents=? WHERE num=1";
   PreparedStatement ps = conn.prepareStatement( sql);
   ps.setBinaryStream( 1, is, data.length);
    
   int x = ps.executeUpdate(); // Throws exception here
 
----- Original Message ----- 
From: "Bryan Pendleton" <bpendleton@amberpoint.com>
To: "Derby Discussion" <derby-user@db.apache.org>
Sent: Friday, September 21, 2007 6:05 PM
Subject: Re: PreparedStatement problem with big BLOBS


>> I do not understand why it only works with small BLOB contents, as soon 
>> as I pass 32750 bytes or so the above happens,
>> when data is 32750 or smaller it works just fine.
> 
> This sounds like a bug to me. The DRDA client/server protocol
> tends to divide data at 32K boundaries, so it's possible that
> there is a bug in that implementation that you have encountered.
> 
> Can you provide a test program that reproduces this problem?
> 
> thanks,
> 
> bryan
> 
>
Mime
View raw message