问题遇到的现象和发生背景
spring boot 2.5.14整合mybatisplus3.5.1时使用@Transactional出现异常
问题相关代码,请勿粘贴截图
org.springframework.jdbc.UncategorizedSQLException:
### Error updating database. Cause: java.sql.SQLException: Error
### The error may exist in com/lnbdy/oa/mapper/file/FileDataMapper.java (best guess)
### The error may involve com.lnbdy.oa.mapper.file.FileDataMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO oa_file_data ( id, file_id, type, sort, name, value, is_title, create_man, create_photo ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: java.sql.SQLException: Error
; uncategorized SQLException; SQL state [null]; error code [0]; Error; nested exception is java.sql.SQLException: Error
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy133.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 8
at com.mysql.cj.protocol.a.NativePacketPayload.readInteger(NativePacketPayload.java:398)
at com.mysql.cj.protocol.a.NativeServerSessionStateController$NativeServerSessionStateChanges.init(NativeServerSessionStateController.java:103)
at com.mysql.cj.protocol.a.result.OkPacket.parse(OkPacket.java:66)
at com.mysql.cj.protocol.a.NativeProtocol.readServerStatusForResultSets(NativeProtocol.java:1755)
at com.mysql.cj.protocol.a.ResultsetRowReader.read(ResultsetRowReader.java:83)
at com.mysql.cj.protocol.a.ResultsetRowReader.read(ResultsetRowReader.java:42)
at com.mysql.cj.protocol.a.NativeProtocol.read(NativeProtocol.java:1651)
at com.mysql.cj.protocol.a.TextResultsetReader.read(TextResultsetReader.java:87)
at com.mysql.cj.protocol.a.TextResultsetReader.read(TextResultsetReader.java:48)
at com.mysql.cj.protocol.a.NativeProtocol.read(NativeProtocol.java:1664)
at com.mysql.cj.protocol.a.NativeProtocol.readAllResults(NativeProtocol.java:1718)
at com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:599)
at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1394)
at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1387)
at com.mysql.cj.jdbc.ClientPreparedStatement.checkReadOnlySafeStatement(ClientPreparedStatement.java:291)
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:301)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3446)
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:434)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3444)
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:152)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483)
... 219 more