tachibana22 opened a new issue, #97: URL: https://github.com/apache/incubator-seata-go-samples/issues/97
**What happened**: In the AT mode server samples (specifically within `at/gin/server`, `at/rollback/server`, and `at/rollback/server2`), when database operations fail or encounter errors, the internal functions log the error but incorrectly return `nil` to the upper layer. As a result, the global transaction middleware or coordinator cannot detect the execution failure, which mistakenly bypasses the global rollback mechanism and attempts a global commit. **What you expected to happen**: The functions in the server samples should explicitly return the caught `error` instead of `nil` so that the failure propagates correctly, enabling the system to trigger a global rollback. **How to reproduce it (as minimally and precisely as possible)**: 1. Start the Seata TC server middleware. 2. Start the AT mode rollback sample server and client. 3. Manually construct a database exception (e.g., rename the target table `order_tbl` to trigger a SQL execution error). 4. Run the client application. Observe that while the server console logs the database error, the transaction is still treated as successful because `nil` was returned, leading to an incorrect commit attempt. **Anything else we need to know**: This defect affects multiple sample files, including: - `at/gin/server/insert_on_update.go` - `at/gin/server/update.go` - `at/rollback/server/insert_on_update.go` - `at/rollback/server/main.go` - `at/rollback/server/update.go` - `at/rollback/server2/insert_on_update.go` - `util/db.go` -- 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]
