Enabling auto reconnect in mysql hibernate spring

in your spring config file append the url entry with the below sample   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${database.driverClassName}" /> <property name="url" value="${database.url}?characterEncoding=UTF-8&amp;autoReconnect=true"/> <property name="username" value="${database.user}" /> <property name="password" value="${database.password}" /> </bean>