Servlets , Commons FileUpload , MySQL and large file trouble

Hey Guys,

I am trying to upload files from a servlet handled page using jakarta commons file upload library into MySQL. I could not upload a 40M file . I can upload smaller size, 1-5 M , haven't tried 10-20 M sizes. MySQL variable for size is set to 64M.

any clues would help a lot !

thanks,

AZ

[328 byte] By [azaidi1a] at [2007-11-27 9:16:00]
# 1
> any clues would help a lot ! > Change your design so that you do not have to hold the whole of the file in memory.
sabre150a at 2007-7-12 22:05:33 > top of Java-index,Java Essentials,Java Programming...
# 2
sabre, what about changing the max_allowed_packet value?
filestreama at 2007-7-12 22:05:33 > top of Java-index,Java Essentials,Java Programming...
# 3

> sabre, what about changing the

> max_allowed_packet value?

I'm not sure this would help since we don't know what the symptoms of the failure are. I suspect that the OP is first trying to load the whole file into memory before writing any of it to MySQL.

If you look at the MySQL manual you see

"Both the client and the server have their own max_allowed_packet variable, so if you want to handle big packets, you must increase this variable both in the client and in the server."

so just changing the client may not work anyway.

sabre150a at 2007-7-12 22:05:33 > top of Java-index,Java Essentials,Java Programming...
# 4

Thanks for the replies guys.

So I changed MySQL variable for packet size to 64M. On my client I am using servlets, specifically, the jakarta commons fileupload library. I am guessing there is a way to change commons threshold , do I change that too ?

My MySQL variable was already 64M before I started testing large files.

azaidi1a at 2007-7-12 22:05:33 > top of Java-index,Java Essentials,Java Programming...
# 5
Not holding file in memory. Its written to the disk and then goes into the DB. I couldn't find a way to directly get the file into the DB. Any clues on this one ?
azaidi1a at 2007-7-12 22:05:33 > top of Java-index,Java Essentials,Java Programming...