Hi,
We are getting some very strange issues. We use Scala in App Engine Standard (Java8) with a 2nd generation Cloud SQL (MySQL).
It's like some result sets are getting parsed on the wrong thread or something.
Some examples include:
* java.lang.ClassCastException: java.lang.Integer cannot be cast to <our domain model>
* java.sql.SQLException: ResultSet is from UPDATE. No Data.
The really bizarre thing is that this only happens once in a blue moon; say once a day for ~20 requests somewhat nearby in time, out of thousands and thousands of requests.
jdbc:mysql://google/${CLOUD_SQL_DATABASE}?cloudSqlInstance=${CLOUD_SQL_INSTANCE}&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC
How does this relate to GAE & Cloud SQL?
Being in GAE seems to be preventing us from troubleshooting for these reasons:
(1) I cannot tell which version of mysql-connector-j is being used. The dependency is swapped out at runtime in some way; from the stacktraces it's clear that the ordinary MySQL connector 5.1.42 is not being used, and the documentation has comments that say "only used locally" for this dependency. If we were able to control the version of mysql-connector-j, then we would use a known good version that is tested with Slick + HikariCP.
(2) This seems to have started happening when we switched to correctly using the com.google.cloud.sql.mysql.SocketFactory . Could there be a bug with this socket factory, or some weird incompatibility with HikariCP or Slick?
I really appreciate any hints to point me in the right direction, this is a pretty brutal problem as the stacktraces are very deep in the MySQL connector code (which is some custom Google version) so I am basically helpless at troubleshooting in any useful way since the stacktraces don't line up with the code.