05-Seata下SQL使用限制

  • 不支持 SQL 嵌套

  • 不支持多表复杂 SQL(自1.6.0版本,MySQL支持UPDATE JOIN语句,详情请看

  • 不支持存储过程、触发器

  • 部分数据库不支持批量更新,在使用 MySQL、Mariadb、PostgreSQL9.6+作为数据库时支持批量,批量更新方式如下以 Java 为例

    复制代码
      // use JdbcTemplate
      public void batchUpdate() {
          jdbcTemplate.batchUpdate(
              "update storage_tbl set count = count -1 where id = 1",
              "update storage_tbl set count = count -1 where id = 2"
          );
      }
    
      // use Statement
      public void batchUpdateTwo() {
          statement.addBatch("update storage_tbl set count = count -1 where id = 1");
          statement.addBatch("update storage_tbl set count = count -1 where id = 2");
          statement.executeBatch();
      }

DML 语句类型、SQL 实例以及 Seata 是否支持,

相关推荐
LiRuiJie1 个月前
深入剖析Seata如何实现分布式事务(主要基于AT模式)
分布式·seata·分布式事务
鼠鼠我捏,要死了捏2 个月前
基于Seata的微服务分布式事务实战经验分享
微服务·seata·分布式事务
东阳马生架构4 个月前
Seata源码—7.Seata TCC模式的事务处理一
分布式·seata·分布式事务
陆小叁4 个月前
若依项目集成sentinel、seata和shardingSphere
sentinel·seata·shardingsphere
东阳马生架构4 个月前
Seata源码—9.Seata XA模式的事务处理
seata
东阳马生架构4 个月前
Seata源码—8.Seata Saga模式的事务处理
seata
东阳马生架构4 个月前
Seata源码—7.Seata TCC模式的事务处理
seata
东阳马生架构4 个月前
Seata源码—6.Seata AT模式的数据源代理
seata
东阳马生架构4 个月前
Seata源码—5.全局事务的创建与返回处理二
分布式·seata·分布式事务
东阳马生架构4 个月前
Seata源码—5.全局事务的创建与返回处理
seata