Mysqii time outs version 2.2.2/3b

In an archiving cron job script now getting the following error messages

ERROR CoreConsole[2014-05-16 14:12:55] [edd10] Mysqli prepare error: MySQL server has gone away

Wait_timeout is currently set to 900 seconds which should be plenty of time (15 mins), and from the error message seem to have gone wrong within about 5 minutes.