参考
正题
数据库连接必须配置:&allowMultiQueries=true
mapper文件代码
<update id="updateMany" parameterType="java.util.List" >
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
UPDATE inf_message
<set>
<if test="item.messageId !=null and item.messageId >= 0 ">
messageId = #{item.messageId},
</if>
<if test="item.segment !=null and item.segment!='' ">
segment=#{item.segment},
</if>
<if test="item.target !=null and item.target!='' ">
target=#{item.target},
</if>
<if test="item.targetReal !=null and item.targetReal!='' ">
targetReal=#{item.targetReal},
</if>
<if test="item.appId !=null and item.appId!='' ">
appId=#{item.appId},
</if>
<if test="item.source !=null and item.source!='' ">
source=#{item.source},
</if>
</set>
WHERE messageId = #{item.messageId}
</foreach>
</update>
这些都配置好后,单元测试发现还是报错
org.springframework.jdbc.UncategorizedSQLException:
### Error updating database.
Cause: java.sql.SQLException: Cannot execute statement:
impossible to write to binary log since BINLOG_FORMAT = STATEMENT
and at least one table uses a storage engine limited to row-based logging.
InnoDB is limited to row-logging
when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
重点在最后一句话 transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
这才发现,执行该语句方法的Spring事务用的是 READ COMMITTED,用 DEFAULT 就好了