数据源配置
java 代码配置
primary
second
serviceImpl代码
报错信息
2019-10-03 21:10:19.158 WARN 12120 --- [ Atomikos:4] c.a.icatch.imp.ActiveStateHandler : Transaction com.tlw.bpm.engine.atomikos.spring.jdbc.tm157010820885800001 has timed out and will rollback.
2019-10-03 21:10:59.237 ERROR 12120 --- [p-nio-80-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.CannotAcquireLockException:
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
### The error may involve com.springboot.demo.dao.primary.PrimaryStudentDao.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO student(id,name) VALUES (?,?)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
; Lock wait timeout exceeded; try restarting transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction