【已解决】ShardingSphere 使用记录,ShardingException: Can not update sharding key, logic table: [user_log]解决

简介 【已解决】ShardingSphere 使用记录,ShardingException: Can not update sharding key, logic table: [user_log]解决

小福利:

凯哥自己开发的,领取外卖、打车、咖啡、买菜、各大电商的优惠券的公¥众¥号。如下图:

527c8a82983e56a30f4299fc76e1956a.png

ShardingException: Can not update sharding key, logic table: [user_log]

直议 : 不能更新 分片的列
看代码发现 update 的逻辑是 分片的列必须在where条件里 并且必须同 更新的值相同。

5ebeecd3fafea115f7a9b41222d4e695.png

简单一句话:在更新的时候,要把分表的字段带上

小福利:

凯哥自己开发的,领取外卖、打车、咖啡、买菜、各大电商的优惠券的公¥众¥号。如下图:

527c8a82983e56a30f4299fc76e1956a.png

TopTop