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

   - [ ] I have registered the PR changes.
   
   **What this PR does**:
   
   `XAConn.ShouldBeHeld` currently treats every known `DBType` as hold-required 
because `DBType.String()` never returns an empty string.
   
   This focused change aligns the fallback with Seata Java:
   
   - retain the connection when the resource capability requires it;
   - retain conservatively when `DBType` is unknown;
   - do not override a known database whose capability says detached phase two 
is supported.
   
   It also adds table-driven regression tests for the three combinations.
   
   Seata Java reference:
   https://github.com/apache/seata/pull/4765
   
   **Which issue(s) this PR fixes**:
   
   Fixes #1149
   
   **Special notes for your reviewer**:
   
   #1147/#1148 contain a broader XA lifecycle and connection-ownership 
redesign. This PR intentionally limits itself to the reversed fallback 
predicate and regression tests.
   
   For MySQL 8.0.29+, version alone is not a complete detached-phase-two 
capability check because `@@session.xa_detach_on_prepare` also matters. This PR 
does not claim to solve that separate probing gap.
   
   **Test Plan**:
   
   ```bash
   go test ./pkg/datasource/sql/... -count=1
   go test -race ./pkg/datasource/sql -run '^TestXAConn_ShouldBeHeld$' -count=1
   ```
   
   **Does this PR introduce a user-facing change?**:
   
   ```release-note
   Fix XA connection retention fallback so known databases are not always 
treated as requiring the original connection.
   ```


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