Error:
WARN : org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: 08S01
ERROR: org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Communications link failure
The data source configuration used initially is as follows
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url"
value="jdbc:mysql://localhost:3306/db_heybar01?useUnicode=true&characterEncoding=UTF-8"/>
<property name="username" value="test"/>
<property name="password" value="test"/>
</bean>
Through the error message and the preliminary judgment of searching is that the number of database connections is not enough, try to change the connection pool:
modified data source configuration:
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="jdbcUrl">
<value>jdbc:mysql://101.201.73.167:3306/db_heybar01?useUnicode=true&characterEncoding=UTF-8</value>
</property>
<property name="properties">
<props>
<prop key="c3p0.minPoolSize">2</prop>
<prop key="c3p0.maxPoolSize">50</prop>
<prop key="c3p0.timeout">5000</prop>
<prop key="c3p0.max_statement">100</prop>
<prop key="c3p0.testConnectionOnCheckout">true</prop>
<prop key="user">nupa01</prop>
<prop key="password">NUPA_mysql_2017</prop>
</props>
</property>
</bean>