baomidou / mybatis-plus

An powerful enhanced toolkit of MyBatis for simplify development
https://baomidou.com
Apache License 2.0
16.33k stars 4.3k forks source link

[错误报告]: 在@async方法中updateById拼接的tenantId =0,造成更新数据失败 #6388

Closed softboy99 closed 1 month ago

softboy99 commented 1 month ago

确认

当前程序版本

3.5.3.2

问题描述

在@async方法中updateById拼接的tenantId =0,造成更新数据失败

详细堆栈日志

Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@54df2b73] was not registered for synchronization because synchronization is not active
JDBC Connection [ConnectionProxyImpl{connectedTime=2024-08-08 13:48:20.613, closeCount=0, lastValidateTimeMillis=2024-08-08 13:48:20.769}] will not be managed by Spring
original SQL: UPDATE sample SET sample_no=?, sample_name=?, raw_data_file=?, analysis_model_id=?, analysis_chart=?, pca_plot=?, conclusion=?, sys_org_code=?, create_by=?, create_time=?, update_by=?, update_time=?, tenant_id=? WHERE id=?
SQL to parse, SQL: UPDATE sample SET sample_no=?, sample_name=?, raw_data_file=?, analysis_model_id=?, analysis_chart=?, pca_plot=?, conclusion=?, sys_org_code=?, create_by=?, create_time=?, update_by=?, update_time=?, tenant_id=? WHERE id=?
parse the finished SQL: UPDATE sample SET sample_no = ?, sample_name = ?, raw_data_file = ?, analysis_model_id = ?, analysis_chart = ?, pca_plot = ?, conclusion = ?, sys_org_code = ?, create_by = ?, create_time = ?, update_by = ?, update_time = ?, tenant_id = ? WHERE id = ? AND tenant_id = 0
==> Preparing: UPDATE sample SET sample_no = ?, sample_name = ?, raw_data_file = ?, analysis_model_id = ?, analysis_chart = ?, pca_plot = ?, conclusion = ?, sys_org_code = ?, create_by = ?, create_time = ?, update_by = ?, update_time = ?, tenant_id = ? WHERE id = ? AND tenant_id = 0
==> Parameters: RG173-2(String), RG173-2(String), temp/RG173-21722513701709.csv(String), 1724264686739726337(String), temp/1818980419708252162.png(String), temp/1818980419708252162pca.png(String), ����������(String), A05(String), doctor_su(String), 2024-08-01 20:01:42.0(Timestamp), doctor_su(String), 2024-08-08 13:49:01.949(Timestamp), 1008(Integer), 1818980419708252162(String)
<== Updates: 0
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@54df2b73]
huayanYu commented 1 month ago

自己解决async问题,和MP无关