UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » Java
  • » Plz help me to resolve the exception.....

#1 2006-08-16 06:35 AM

surya_jc
Member
Registered: 2006-07-18
Posts: 8

Re: Plz help me to resolve the exception.....

[color="Blue"]If some body can help me in this issue plz.....

I wrote one java pgm which downloads the data from the particular url......
& its working fine also for the data or files with size having less than 1MB no matter what type of file it is .....

But if it is more than 1MB it creates the issue.....

And giving the exception [/color][color="Red"]packet size too large ...... you can change the limit by setting the variable max_allowable_packet size......[/color]

[color="Blue"]I'm using MySQL database and the driver jdbc:mysql......
I tried a lot of steps to change the [COLOR="Red"]variable max_allowable_packet size [/color]but it didn't worked....
> like change in the my.ini file etc................

So if any body can help me plz ............
I trying this for more than 2 weeks.........

Thanks in advance................[/COLOR]

Offline

#2 2006-08-17 09:30 AM

thinking
Member
Registered: 2005-09-15
Posts: 103

Re: Plz help me to resolve the exception.....

http://bugs.mysql.com/bug.php?id=19402

maybe it's already fixed
try current mysql version
or get postgresql ;-)

greetz

Offline

#3 2006-08-18 10:45 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: Plz help me to resolve the exception.....

May I humbly suggest... that you modify your tables for storage to something ( like ) the following:

int        ( id )
foreignkey ( self id )
int        ( block id )
blob       ( data )

Where the first col is a generated unique id... the foreign key is pointing back to an id of an object of the same type...  the block id is to allowed proper ordering of all blocks where id == self id == ( some value ) ...  more or less just a simplistic inode-ish type system...

The rational is that by limiting the data blob segment to a size that you know will work on ANY ( or a large number of ) db / driver combo impls... then it - in the end - makes it much simpler for any users / maintainers of the system... though it does add ( slightly ) more load on the db...

Of course...

I'm more of a defensive programmer than most... but there is a reason...  I've just had to suffer thru too many times where product 'A' required a specific dependency version... and product 'B' required the same dependency but a different version ( or range of versions )...  AND the thing was I wanted to use both products A and B but couldn't... so as a programmer I want users of my code to avoid the same sort of frustration if possible...


Michael


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

  • Index
  • » Java
  • » Plz help me to resolve the exception.....

Board footer

Powered by FluxBB