thunguo opened a new issue, #1089: URL: https://github.com/apache/incubator-seata-go/issues/1089
## Background The current XA mode implementation is tightly coupled to MySQL. To support PostgreSQL, Oracle, and other databases, we need a pluggable abstraction layer. ## Current Problems 1. XA resource creation is hardcoded to MySQL, even when the actual database type is different. 2. The Oracle XA implementation is a broken stub that copies MySQL XA SQL syntax — Oracle requires `DBMS_XA` PL/SQL calls instead. 3. The XA connection proxy layer directly imports the MySQL driver package for error handling, making it impossible to work with other databases. 4. The database type parser only recognizes MySQL. ## Database Protocol Differences | | MySQL | PostgreSQL | Oracle | |---|---|---|---| | Protocol | `XA START/END/PREPARE/COMMIT` SQL | `PREPARE TRANSACTION / COMMIT PREPARED` SQL | `DBMS_XA.*` PL/SQL | | Start/End phase | Yes | No-op (uses regular BEGIN) | Yes (PL/SQL calls) | | XID format | String | gid string | DBMS_XA_XID structured type | ## Proposal 1. Introduce `XAErrorClassifier` interface to decouple database-specific error handling from the connection proxy layer. 2. Introduce `XAResourceFactory` registry pattern — each database registers via `init()`, replacing the hardcoded switch-case. 3. Fix XA resource creation to use the actual database type. 4. Add PostgreSQL and Oracle scaffolding with TODO stubs for concrete SQL/PL/SQL. 5. Extend database type parsing to recognize postgres, oracle, sqlserver, mariadb. -- 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]
