github-actions[bot] commented on issue #1128: URL: https://github.com/apache/incubator-seata-go/issues/1128#issuecomment-4881835636
> Bot detected the issue body's language is not English, translate it automatically. # # # ✅ Validation Checklist - [x] 🔍 I've searched [existing issues] (https://github.com/apache/incubator-seata-go/issues) and I'm sure it's not a duplicate request - [x] 📋 I have reviewed the [release notes] (https://github.com/apache/incubator-seata-go/releases) and am confident that this feature has not been implemented - [] 🛠️ I am willing to take care of this on my own # # # 🎯 Function description In the AT mode of Seata for Java, when the application binds multiple sets of parameters with the same SQL template through JDBC's `PreparedStatement.addBatch ()` + 'executeBatch ()' (the typical scenario is batch update/insert/delete), the SQL actuator builds the correct pre-image/post-image and rollback logs for the entire batch, ensuring that the entire operation can be correctly rolled back as a whole.seata-go does not currently have a corresponding processing path for the "One SQL Template + Multiple Group Parameter Batch Execution" scenario.Actuators that support batch semantics (or extend existing insert/update/delete executors) need to be added to enable AT mode to handle this batch execution: - Correctly build front/rear mirrors for all rows involved in the entire batch; - Generate consistent, atomic rollback logs for the entire batch; - Correctness of the rollback is guaranteed even if partial execution in the batch fails. The implementation should align the semantics of the Java version as much as possible, taking into account the limitations of the Go 'database/sql `driver model. # # # 📋 Usage scenarios - Using the Go service/ORM framework, batch execution of multiple sets of parameters bound to the same SQL template (such as pressing the primary key to batch update, batch insertion) to increase throughput, which is consistent with the common usage of `addBatch`/'executeBatch' in Java services, facilitating a smooth transition from Java to Go. - Data migration/batch tasks that rely on batch DML for performance. # # # ⚖️ Complexity and risk assessment _No response_ # # # 🔗 External dependenciesGo's `database/sql` driver interface itself does not have a 'batch' concept equivalent to the JDBC batch API. The proxy layer needs to be able to identify/express a set of parameters, and ensure that the image construction and rollback log generation are consistent and atomic throughout the batch range. Extreme caution is required in design. # # # 📚 Additional information Reference: The implementation of bulk update/insert/delete in the Seata (2.x) SQL executor for Java has been mentioned in the code related to the seata-go parser as a compatibility design baseline. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
