Newer versions of Bacula create a temporary working table in order to do batch inserts, which can greatly speed up inserting attributes into the catalog. Unfortunately, if the MySQL connection gets dropped for any reason (such as a timeout) the temporary table goes away. If you're seeing these problems, there are two workarounds.
The simplest one is to turn off batch inserts. This will revert to the older, somewhat slower behavior, but it should avoid this particular glitch.
The other option is to alter the MySQL timeouts to a sufficiently long value that the connection never gets yanked out from under Bacula. For example, adding these two lines to your my.cnf file in the [mysqld] block will set the relevant timeouts to 8 days.
wait_timeout=691200
interactive_timeout=691200
Future versions of MySQL will automatically set the timeout values, which should prevent the problem without requiring changing the global MySQL timeout values.