问答详情
源自:4-4 基于myBatis实现DAO编程(上)

Java高并发秒杀API跑一个Test测试都不行

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

### The error may exist in file [E:\seckill2\target\classes\mapper\SeckillDao.xml]

### The error may involve org.seckill.dao.SeckillDao.queryAll

### The error occurred while executing a query

### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

这是什么原因?

提问者:MartinCode 2018-02-13 21:30

个回答

  • MartinCode
    2018-02-14 14:02:33

    我用5.7的数据库可以成功查询,用5.1的数据库就不可以,这是为什么,?