You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Davide Baroncelli <ba...@yahoo.com> on 2002/03/29 01:51:57 UTC

Are blobs supported at all?

Hi, 
there is something I don't understand, with the whole blob stuff in torque: I tried defining a BLOB column, which has correctly created the column in my database. But the problems start as soon as I try to save a record: Torque relies on Village, which incurs in a JDK bug related to the way oracle answers to the ResultsetMetaData method getPrecision(): since the size of a BLOB may be 4Gb, the Integer.parseInt method explodes and throws a NumberFormatException. The same does NOT happen with LONG as it allows "only" 2Gb of data.

Well, just to try, I patched village and caused it to swallow the NumberFormatException, answering Integer.MAX_VALUE to the getPosition. I wanted to see how the blob management is done but... it seems there is no blob management at all! If I have correctly understood what happens, loading a 128 Kb image, and putting it in a blob column does not work as expected: after some working, the save method just takes the byte array and uses it to create a string, which is then put into the db with a 
            default:
                stmt.setString (stmtNumber, this.asString());
                break;

where stmt is a prepared statement which has a ? for the picture column. Well, at this point Oracle complains about the size of the picture, which exceeds a maximum: actually, Oracle documentation states that in order to work with blobs and clobs one has to use streaming, so trying to use setXXX methods is useless, and Oracle BLOB support in Torque is not really working. Am I wrong? 

Re: Are blobs supported at all?

Posted by Rajeev Kaul <Ra...@customercaresolutions.com>.
No, neither BLOBS nor CLOBS are supported in Torque.

----- Original Message -----
From: "Davide Baroncelli" <ba...@yahoo.com>
To: <tu...@jakarta.apache.org>
Sent: Thursday, March 28, 2002 4:51 PM
Subject: Are blobs supported at all?


Hi,
there is something I don't understand, with the whole blob stuff in torque:
I tried defining a BLOB column, which has correctly created the column in my
database. But the problems start as soon as I try to save a record: Torque
relies on Village, which incurs in a JDK bug related to the way oracle
answers to the ResultsetMetaData method getPrecision(): since the size of a
BLOB may be 4Gb, the Integer.parseInt method explodes and throws a
NumberFormatException. The same does NOT happen with LONG as it allows
"only" 2Gb of data.

Well, just to try, I patched village and caused it to swallow the
NumberFormatException, answering Integer.MAX_VALUE to the getPosition. I
wanted to see how the blob management is done but... it seems there is no
blob management at all! If I have correctly understood what happens, loading
a 128 Kb image, and putting it in a blob column does not work as expected:
after some working, the save method just takes the byte array and uses it to
create a string, which is then put into the db with a
            default:
                stmt.setString (stmtNumber, this.asString());
                break;

where stmt is a prepared statement which has a ? for the picture column.
Well, at this point Oracle complains about the size of the picture, which
exceeds a maximum: actually, Oracle documentation states that in order to
work with blobs and clobs one has to use streaming, so trying to use setXXX
methods is useless, and Oracle BLOB support in Torque is not really working.
Am I wrong?



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>