Hi,
I have a java application calling percona mysql through a generic data access library.
Every so often calls will fail with this error:-
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [UPDATE "Connector" SET "field_status"=?,"field_lastCheckedAt"=? WHERE "id"= ?]; SQL state [HY000]; error code [1243]; Unknown prepared statement handler (1094996053) given to mysqld_stmt_execute; nested exception is java.sql.SQLException: Unknown prepared statement handler (1094996053) given to mysqld_stmt_execute
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) ~[org.springframework.jdbc_3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) ~[org.springframework.jdbc_3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) ~[org.springframework.jdbc_3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602) ~[org.springframework.jdbc_3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:811) ~[org.springframework.jdbc_3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:867) ~[org.springframework.jdbc_3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:875) ~[or
It only seems to happen on my production environment which is setup in a master<->master percona cluster, there is also an AWS elb between the java application and the mysql. This error doesn't happen in a development environment single app server, single db node, no elb.
Currently the jdbc connection string is (new lines added for clarity):-
jdbc:mysql://mysqlserver:3306/thedb?user=user&
password=password&
cacheServerConfiguration=true&
elideSetAutoCommits=true&
alwaysSendSetIsolation=false&
enableQueryTimeouts=false&
cacheResultSetMetadata=true&
useUnicode=true&
characterEncoding=UTF-8&
cachePrepStmts=false&
connectionCollation=utf8_general_ci&
useServerPrepStmts=true&
prepStmtCacheSqlLimit=1000&
rewriteBatchedStatements=true&
useLocalSessionState=true&
useLocalTransactionState=true&
tcpKeepAlive=true&
tcpTrafficClass=24&
allowMultiQueries=true&
maintainTimeStats=false
In the app server I am pooling connection using the C3P0 library, setup like so:-
dataSource = new ComboPooledDataSource();
dataSource.setJdbcUrl(jdbcUrl);
dataSource.setDriverClass(driverClass == null ? null : driverClass.getName());
dataSource.setPreferredTestQuery("select 1");
dataSource.setIdleConnectionTestPeriod(30);
dataSource.setTestConnectionOnCheckin(true);
dataSource.setMaxPoolSize(200);
dataSource.setMinPoolSize(50);
dataSource.setMaxStatementsPerConnection(0);
It doesn't happen consistently and the id is always 1094996053, even after all the app servers have been restarted!
What could the cause be?
Any help much appreciated.
Ian Clark
Hi,
I have a java application calling percona mysql through a generic data access library.
Every so often calls will fail with this error:-
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [UPDATE "Connector" SET "field_status"=?,"field_lastCheckedAt"=? WHERE "id"= ?]; SQL state [HY000]; error code [1243]; Unknown prepared statement handler (1094996053) given to mysqld_stmt_execute; nested exception is java.sql.SQLException: Unknown prepared statement handler (1094996053) given to mysqld_stmt_execute at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) ~[org.springframework.jdbc_3.0.3.RELEASE.jar:3.0.3.RELEASE]
It only seems to happen on my production environment which is setup in a master<->master percona cluster