0

Could see following errors when connecting to GCP- Mysql instance .

org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: 08S01
 ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

org.hibernate.event.internal.DefaultLoadEventListener - HHH000327: Error performing load command : org.hibernate.exception.JDBCConnectionException: Could not open connection
javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection

Following are done as part of preliminary steps

Set both

wait_timeout
2147483
interactive_timeout
2147483

Configuratiion

    <property name="driverClassName" value="com.mysql.jdbc.GoogleDriver" /> 
    <property name="url" value="jdbc:google:mysql://sqlinstanceConnectionstring" /> 
    <property name="username" value="root" />
    <property name="password" value="*****" />
    <property name="initialSize" value="50" />
    <property name="maxActive" value="100" />
    <property name="maxIdle" value="2" />
    <property name="validationQuery" value="Select 1" />
    <property name="removeAbandonedTimeout" value="30" />
    <property name="removeAbandoned" value="true" />
    <property name="logAbandoned" value="true" />
</bean>

any help appreciate

iker lasaga
  • 330
  • 1
  • 3
  • 18
  • Where are you connecting from (external application, app engine...)? Keep in mind that the `com.mysql.jdbc.GoogleDriver` is designed for App Engine Standard environment. You can also check this other thread where the same issue is discussed https://stackoverflow.com/questions/37644148/java-lang-illegalstateexception-could-not-load-jdbc-driver-class-com-mysql-jdb – iker lasaga Sep 02 '20 at 10:15
  • As mentioned above connecting from App engine to google mysql sql instance. I could see SQL state 8s01 and connection Communications link failure – user14206673 Sep 02 '20 at 17:15
  • App Engine Standard or Flexible? – iker lasaga Sep 03 '20 at 10:04
  • App Engine Standard only – user14206673 Sep 03 '20 at 22:18
  • Could you share a snipet of how the configuration is structured in the code? – iker lasaga Sep 22 '20 at 06:16

0 Answers0