"blobSendChunkSize" property does not work
Posted by: John Andrew Balandra
Date: October 15, 2012 03:31AM

Hi,

My problem is - I only have a "max_allowed_packet" = 1MB on the server. We are somewhat limited in a way that we cannot change this setting on the server. I have a table with a longblob field for which I hope I can store a zipped file. As far as my readings go, we can pass some property values within the DB URL in order to specify our preferred "blobSendChunkSize" property value. And with this property set, the connector should be able to to sent a big file (eg. 8MB) in chunks of 1MB (my "max_allowed_packet" value). Is my understanding correct?

What I don't understand is - why doesn't it seem to work? I still keep on getting "Packet for query is too large." errors. Below is an example of my modified URL:

URL
===
Connection con = DriverManager.getConnection
("jdbc:mysql://localhost:3306/for_testing?blobSendChunkSize=1000000&maxAllowedPacket=1048576", "user", "Password");

After the above line has been executed, I examined the "con" object and it seemed that the properties were not changed.

I tried to set it directly within our class. The new values were persisted but I'm still getting the error upon executing the Prepared Statement. Below is the snippet of my class setting the two properties.

Code
====
if (con instanceof JDBC4Connection){
JDBC4Connection jdbcCon = (JDBC4Connection)con;
jdbcCon.setMaxAllowedPacket(1048576);
jdbcCon.setBlobSendChunkSize("1000000");
}

Questions
=========
1. Am I missing some steps here in order to achieve the goal I wanted?
2. Are there other ways of doing this with due consideration to our limitations?
3. Is this a bug?

Note:
We're using "mysql-connector-java-5.1.21-bin.jar" in our integration.

I'm hoping for your fast reply - I'm stuck with this. Thank you.

- John Balandra



Edited 2 time(s). Last edit at 10/15/2012 03:34AM by John Andrew Balandra.

Options: ReplyQuote


Subject
Written By
Posted
"blobSendChunkSize" property does not work
October 15, 2012 03:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.