soap4r Mysql::Error: MySQL server has gone away:

hi all

i m using soap4r concept for my application. and also different
database for client application.
in client application it works fine in the beginning but after when i
keep my application idle,
it throws error as Mysql::Error: MySQL server has gone away, while
connecting to server database.
do anyone know y this happens...

please..

thanks in advance..
if anyone knows please give some ideas..