When running a multi-threaded C application using Poco::Data::MySQL
and Poco::Data::SessionPool
, an ER_NET_PACKETS_OUT_OF_ORDER
error occurs. The error message looks like this:
MySQL: [MySQL]: [Comment]: mysql_stmt_prepare error [mysql_stmt_error]: Got packets out of order [mysql_stmt_errno]: 1156 [mysql_stmt_sqlstate]: 08S01 [statemnt]: ...
The application queries from multiple threads every 100 milliseconds. Connections are provided by the public SessionPool
.
I solved this problem by adding
reset=true
to the connection string. However, as stated in the Official Documentation, adding this option may cause encoding issues.