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