I'm developing an application using Apache Turbine + Torque and Oracle 10g for my DB and am encountering this error:
java.sql.sqlexception data size bigger than max size for this type.
I've searched it in Google and everyone says that you should use a BLOB type instead of a LONG RAW, but my problem is that I'm using BLOB to store a 17k image in the database. My code is as follows:
I have trimmed the rest of it as it is non-relevant, but the basics are there. I'm using a Torque object (entryIntratImagenes) to save into the database, and am getting the image bytes through a regular SQL Query.
My table is as follows:
What could be wrong? Why is it telling me the max size for BLOB is not big enough to save 17k bytes?
It lies within the Oracle JDBC driver. Apparently there's a bug in the version I was using that sets LOB file types to a maximum size of 4K, which renders them almost useless.
I just downloaded a new driver version (10.2.0.4 I believe) and it all worked flawlessly. At least in my local machine....because as soon as I deploy it on our webserver (Oracle App Server) it breaks again
Well, it turns out that for some reason my App Server is not using the updated ojdbc14 library, so the error persists.
If anyone is still interested, the workaround was to insert every other piece of data besides the Blob (insert null in the blob) and the either update the blob field using an OutputStream or directly from another table in the same database and it will work fine.
I hope this helps.
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop