CAICAIIs opened a new pull request, #1057:
URL: https://github.com/apache/incubator-seata-go/pull/1057

   <!--  Thanks for sending a pull request!
   -->
   <!-- Please make sure you have read and understood the contributing 
guidelines -->
   
   - [x] I have registered the PR 
[changes](https://github.com/apache/incubator-seata-go/tree/master/changes).
   
   **What this PR does**:
   This PR implements full Oracle XA support to resolve the panic issue when 
using Oracle database with XA distributed transactions.
   **Key changes:**
   1. **Implemented 5 previously panicking methods in `OracleXAConn`:**
      - `Forget(ctx, xid)` - Execute `XA FORGET` command
      - `GetTransactionTimeout()` - Return stored timeout value
      - `SetTransactionTimeout(duration)` - Store timeout configuration
      - `IsSameRM(ctx, xares)` - Compare resource managers
      - `Recover(ctx, flag)` - Execute `XA RECOVER` and return prepared XIDs
   2. **Fixed all method signatures to match `XAResource` interface:**
      - Added `context.Context` as first parameter to all methods
      - Fixed `XAPrepare` return type from `(int, error)` to `error`
      - Replaced `context.TODO()` with passed context
   3. **Enhanced existing implementations:**
      - Added XID quoting (`'xid'`) to prevent SQL injection
      - Fixed SQL syntax (missing space in `XA START`)
      - Added comprehensive logging (Info/Error)
      - Added flag validation (TMJoin, TMResume, TMSuspend, etc.)
   4. **Infrastructure improvements:**
      - Registered Oracle XA driver in factory (`NewOracleXaConn`)
      - Added Oracle driver name parsing (`oracle`, `go-ora`)
      - Added constructor `NewOracleXaConn()`
   
   **Which issue(s) this PR fixes**:
   
   <!--
   *Automatically closes linked issue when PR is merged.
   Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
   _If PR is about `failing-tests or flakes`, please post the related 
issues/tests in a comment and do not use `Fixes`_*
   -->
   
   Fixes #1056 
   
   **Special notes for your reviewer**:
   
   **Does this PR introduce a user-facing change?**:
   
   <!--
   If no, just write "NONE" in the release-note block below.
   If yes, a release note is required:
   Enter your extended release note in the block below. If the PR requires 
additional action from users switching to the new release, include the string 
"action required".
   -->
   Oracle database is now fully supported in XA distributed transaction mode. 
Previously, using Oracle with XA mode would cause panic. Users can now:
   - Use Oracle database with Seata XA transactions
   - Execute all XA operations: START, END, PREPARE, COMMIT, ROLLBACK, RECOVER, 
FORGET
   - Configure Oracle XA via standard Go sql.Open with "seata-xa-oracle" driver 
name
   Example usage:
   ```go
   import sql2 "seata.apache.org/seata-go/pkg/datasource/sql"
   db, err := sql.Open(sql2.SeataXAOracleDriver, 
"oracle://user:pass@host:1521/XE")
   // Use db with XA transactions
   Required setup: Oracle database users need to grant XA privileges:
   GRANT SELECT ON sys.dba_pending_transactions TO username;
   GRANT EXECUTE ON sys.dbms_xa TO username;
   ```
   ```release-note
   Add Oracle XA support.
   ```
   


-- 
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]

Reply via email to