HTTP Status 500 - Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
你的代码里自动释放数据库链接的逻辑写的有没有问题,你是SSM框架,给你几个排查思路:
1、本地测试数据库服务是否异常;
2、Spring对Mybatis重新封装的SqlSessionTemplate 类里的finally方法是否漏写;
3、数据源管理类DataSourceTransactionManager里的释放方法releaseConnection方法是否漏写;
4、方法上是否忘记使用@Transactional注解;
5、数据库连接池配置里面定义的最大连接数是不是太小了。
```
说的很清楚了啊,不能打开一个数据库连接。
Could not open JDBC Connection for transaction;