My web application is using Hibernate as ORM to connect to MySQL version Community Server (GPL) 5.6.24. Recently, I usually get the exception from the server like this:
2016-04-06 19:44:25 WARN SqlExceptionHelper:144 - SQL Error: 0, SQLState: S1000
2016-04-06 19:44:25 ERROR SqlExceptionHelper:146 - Packet for query is too large (2278 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.
2016-04-06 19:46:01 WARN SqlExceptionHelper:144 - SQL Error: 0, SQLState: S1000
2016-04-06 19:46:01 ERROR SqlExceptionHelper:146 - Packet for query is too large (2257 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.
After the exception rise, instead of returning the query result, the server return this message:
org.hibernate.exception.GenericJDBCException: could not extract ResultSet
I make a lot of research about this problem. I try to increase max_allowed_packet parameter of mysql configuration to 1GB like this guide (link) but it still didn't work anymore.
So how can I detect exactly which is query that lead to exception ?
Updated: More information about my web application:
- Recently, it's not a large application. The database just saves normal text data, not image information, not blob text data !
- It's a crawler system. It receives request from user, get data from another side and return result back to user.
- It saves user information, order from users, v.v... Each table takes less than 10,000 rows !