Home > Back-end >  For help, springboot mybatis is essentially, the transaction will not roll back!
For help, springboot mybatis is essentially, the transaction will not roll back!

Time:10-29

Springboot mybatis essentially a transaction cannot be rolled back

Console tips

Yao has joined transaction management, throw an exception or not rollback

13:58:03. [HTTP - nio - 9000-061 the exec - 15] INFO C.N.C.U.D.D ynamicDataSourceContextHolder - [setDataSourceType, 26] - switch to SQLSERVER_ERP data
Creating a new SqlSession
Registering transaction synchronization for SqlSession [org. Apache. Ibatis. Session. Defaults. DefaultSqlSession @ 5 a38ece8]
The JDBC Connection [com. Alibaba. Druid. Proxy. JDBC. ConnectionProxyImpl @ 595277 fa] will be managed by the Spring
SQL prompt yapping
Releasing transactional SqlSession [org. Apache. Ibatis. Session. The defaults. DefaultSqlSession @ 5 a38ece8]
Fetched SqlSession [org. Apache. Ibatis. Session. The defaults. DefaultSqlSession @ 5 a38ece8] from the current transaction
SQL prompt yapping
Releasing transactional SqlSession [org. Apache. Ibatis. Session. The defaults. DefaultSqlSession @ 5 a38ece8]
Fetched SqlSession [org. Apache. Ibatis. Session. The defaults. DefaultSqlSession @ 5 a38ece8] from the current transaction
Insert SQL, insert executed after int a=1/0;
Releasing transactional SqlSession [org. Apache. Ibatis. Session. The defaults. DefaultSqlSession @ 5 a38ece8]
The Transaction synchronization deregistering SqlSession [org. Apache. Ibatis. Session. Defaults. DefaultSqlSession @ 5 a38ece8]
The Transaction synchronization closing SqlSession [org. Apache. Ibatis. Session. Defaults. DefaultSqlSession @ 5 a38ece8]

search a lot of posts, there should be a normal transaction rollback tip, but I there is no
13:58:03. [HTTP - nio - 9000-313 the exec - 15] ERROR C.N.F.E.G lobalExceptionHandler - [notFount, 64] - a runtime exception:
Java. Lang. ArithmeticException/by zero:
At com. NBPT. Yygs. Service. HKHXKH. Impl. YygsHkhxServiceImpl. ExcuteUpdateAndInsert (YygsHkhxServiceImpl. Java: 274)
At com. NBPT. Yygs. Service. HKHXKH. Impl. YygsHkhxServiceImpl. Hexiao (YygsHkhxServiceImpl. Java: 245)
At com. NBPT. Yygs. Service. HKHXKH. Impl. YygsHkhxServiceImpl. Ywyzidonghexiao (YygsHkhxServiceImpl. Java: 84)
  • Related