Transactions 如何使用PlatformTransactionManager在单个事务中提交或回滚多个INSERT查询?

Transactions 如何使用PlatformTransactionManager在单个事务中提交或回滚多个INSERT查询?,transactions,insert,commit,rollback,Transactions,Insert,Commit,Rollback,我得到了一个场景,它要么提交,要么回滚(如果有错误的话)多个insert查询。有没有想过使用PlatformTransactionManager将其归档 例如: 场景1(无错误) ========================================================== 执行插入而不提交 执行插入B而不提交 执行插入C而不提交 提交插入A、B、C 场景2(有错误) ===================================================

我得到了一个场景,它要么提交,要么回滚(如果有错误的话)多个insert查询。有没有想过使用PlatformTransactionManager将其归档

例如:
场景1(无错误)
==========================================================
执行插入而不提交
执行插入B而不提交
执行插入C而不提交
提交插入A、B、C

场景2(有错误)
==========================================================
执行插入而不提交
执行插入B而不提交
执行插入C而不提交(有错误!)
回滚插入A、B、C