Bug #1534 how to store large blobs? got PacketTooBigException
Submitted: 11 Oct 2003 7:48 Modified: 12 Oct 2003 11:47
Reporter: Ralf Hauser Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Documentation Severity:S3 (Non-critical)
Version:3.1 of Oct 3 2002 OS:Linux (Red Hat 9)
Assigned to: Mark Matthews CPU Architecture:Any

[11 Oct 2003 7:48] Ralf Hauser
Description:
in MySQLIO.java, I see
    // changed once we've connected.
    private int maxAllowedPacket = 1024 * 1024;
but I don't see how to change this? No setter methods?

Probably
../mysql/bin/winmysqladmin.exe apparently lets me configure that, but how can I do that on the linux side?

How to repeat:
every time

Suggested fix:
Couldn't the exception mention something about the "max_allowed_packet"?
or http://www.mysql.com/doc/en/Packet_too_large.html or http://www.mysql.com/doc/en/Option_files.html

quite some others seem to have struggled with this too! http://forum.java.sun.com/thread.jsp?thread=364460&forum=48&message=1891508
[11 Oct 2003 8:14] Mark Matthews
I've changed the exception message to be more 'friendly'. The suggestions that we make the packet size 'logically infinite' on Sun's forum are not practical, because this then becomes an opening for a 'denial-of-service' type attack, as the server needs to allocate enough memory to hold the incoming packet :(

I have never had a user report this error to me after the code was added to 3.0 to 'detect' max_allowed_packet. Does the JDBC driver do this correctly for you now?
[12 Oct 2003 2:51] Ralf Hauser
thx, at least since we changed the max_allowed_packet, it works beautifully for the ~ 2.5 MB files we are right now testing with.
[12 Oct 2003 11:47] MySQL Verification Team
I am closing this report according your last comment.
[13 Oct 2003 5:23] Ralf Hauser
Mark, just noticing with the flurry of config files one can set (especially my colleague on window$).
===> when this exception is thrown, please also print out what the currently set value is (we are trying now for the n-th time a 5 Minute - upload of 60MB, but every time, there is still one variable left in one of those config files that is not yet set properly and we don't know which value to search for...  ;)   )
Rgds Ralf