KB Article #176495

"Packet for query is too large" warning message

Problem

The following warning messages are observed in the TM log:

"java.sql.BatchUpdateException: Packet for query is too large (1049589 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable."

Resolution

During heavy load you could observe the following WARN messages within the TM log of SecureTransport:

2014-10-06 13:00:04,070 WARN [EventsPersistsDaemon] com.tumbleweed.st.server.eventqueue.impl.EventPersister - Event persist daemon caught an exception.
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
    at org.hibernate.impl.StatelessSessionImpl.managedFlush(StatelessSessionImpl.java:329)
    at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
    at com.tumbleweed.st.server.eventqueue.impl.EventPersister.doWork(EventPersister.java:130)
    at com.tumbleweed.st.server.eventqueue.impl.EventPersister.access$300(EventPersister.java:26)
    at com.tumbleweed.st.server.eventqueue.impl.EventPersister$WorkerThread.run(EventPersister.java:158)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.BatchUpdateException: Packet for query is too large (1049589 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
    at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1666)
    at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1082)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
    at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
    ... 6 more


The issue is caused by event data which does not get committed to the database. The event data retains within the TM threads which are never closed and eventually could cause TM to exhaust its memory. Another symptom is files getting stuck in progress or subscriptions not triggering at their defined time.

To remedy the situation:

  1. make a backup of <FILEDRIVEHOME>/conf/mysql.conf
  2. add the following line to 'mysql.conf', under #tuning:
     max_allowed_packet=16M
  3. restart all services