SQLException - Could not retrieve transation read-only status server
Posted by: Anusha Dasari
Date: February 03, 2020 02:56AM

A few of the insert queries on a few tables, seem to be failing with the following error:

application-2020-01-30-3.log.gz:org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: java.sql.SQLException: Could not retrieve transation read-only status server [statement:"INSERT INTO TABLE ({FIELDS}) VALUES({VALUES})", located:"INSERT INTO TABLE ({FIELDS}) VALUES({VALUES})", rewritten:"/* TableDAO.save */ INSERT INTO TABLE ({FIELDS}) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)"
application-2020-01-30-3.log.gz: at org.skife.jdbi.v2.SQLStatement.internalExecute(SQLStatement.java:1338)
application-2020-01-30-3.log.gz: at org.skife.jdbi.v2.Update.executeAndReturnGeneratedKeys(Update.java:82)
application-2020-01-30-3.log.gz: at org.skife.jdbi.v2.sqlobject.UpdateHandler$1.value(UpdateHandler.java:56)
application-2020-01-30-3.log.gz: at org.skife.jdbi.v2.sqlobject.UpdateHandler.invoke(UpdateHandler.java:79)
application-2020-01-30-3.log.gz: at org.skife.jdbi.v2.sqlobject.SqlObject.invoke(SqlObject.java:224)
application-2020-01-30-3.log.gz: at org.skife.jdbi.v2.sqlobject.SqlObject$3.intercept(SqlObject.java:133)
application-2020-01-30-3.log.gz: at org.skife.jdbi.v2.sqlobject.CloseInternalDoNotUseThisClass$$EnhancerByCGLIB$$dd33673f.save(<generated>)
application-2020-01-30-3.log.gz: at com.zoomcar.services.inventory.core.impl.UtilizationManagerImpl.calculateUtilization(UtilizationManagerImpl.java:233)
application-2020-01-30-3.log.gz: at com.zoomcar.services.inventory.scheduler.jobs.UtilizationCalculationJob.execute(UtilizationCalculationJob.java:25)
application-2020-01-30-3.log.gz: at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
application-2020-01-30-3.log.gz: at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
application-2020-01-30-3.log.gz:Caused by: java.sql.SQLException: Could not retrieve transation read-only status server
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:489)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:2610)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:2576)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.PreparedStatement.checkReadOnlySafeStatement(PreparedStatement.java:1082)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.PreparedStatement.execute(PreparedStatement.java:1102)
application-2020-01-30-3.log.gz: at jdk.internal.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
application-2020-01-30-3.log.gz: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
application-2020-01-30-3.log.gz: at java.base/java.lang.reflect.Method.invoke(Method.java:566)
application-2020-01-30-3.log.gz: at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
application-2020-01-30-3.log.gz: at com.sun.proxy.$Proxy72.execute(Unknown Source)
application-2020-01-30-3.log.gz: at org.skife.jdbi.v2.SQLStatement.internalExecute(SQLStatement.java:1327)
application-2020-01-30-3.log.gz: ... 10 common frames omitted
application-2020-01-30-3.log.gz:Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 67,698,890 milliseconds ago. The last packet sent successfully to the server was 67,698,891 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:590)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:57)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:1983)
application-2020-01-30-3.log.gz: at com.mysql.cj.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:1936)
Application framework: Dropwizard

DB URL used: "jdbc:mysql://{domain-name}:{port}/{DB_NAME}?autoReconnect=true&useSSL=false"

DB Driver Class: com.mysql.jdbc.Driver

Application uses Amazon RDS

mysql-connector-version is 6.0.6

Options: ReplyQuote


Subject
Written By
Posted
SQLException - Could not retrieve transation read-only status server
February 03, 2020 02:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.