You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/09/23 06:04:06 UTC

[GitHub] [incubator-seatunnel] ic4y opened a new issue, #2859: [Dev][Jdbc connector] Support the session pool

ic4y opened a new issue, #2859:
URL: https://github.com/apache/incubator-seatunnel/issues/2859

   ### Search before asking
   
   - [X] I had searched in the [feature](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22) and found no similar feature requirement.
   
   
   ### Description
   
   The exact-once semantics of the current jdbc sink are implemented through XA transactions. The current implementation relies on a single database connection to open multiple XA transactions at the same time, for example:
   
   ```
   1、Start xid1 transaction
   xa start "xid1"
   xa end  "xid1"
   xa prepare "xid1"
   
   2、Uncommitted but need to open  another xid2
   xa start "xid2"
   xa end  "xid2"
   xa prepare "xid2"
    
   3、Then it is possible to submit
   xa commit "xid1"
   xa commit "xid2"
   ```
   
   This requires a connection to open multiple transactions at the same time, which requires version >=8.0.29 in mysql, and other databases need to support the same connection to open multiple transactions at the same time.
   
   If a connection can only open one XA transaction at the same time, then we can use multiple connections to open multiple XA transactions at the same time. This is the session pool。for example:
   
   ```
   1、Get c1 from the connection pool, start xid1
   c1 = pool.getconnection("c1")
   c1 xa start "xid1"
   c1 xa end  "xid1"
   c1 xa prepare "xid1"
   
   2、Get c2 from the connection pool, start xid2
   c2 = pool.getconnection("c2")
   c2 xa start "xid2"
   c2 xa end  "xid2"
   c2 xa prepare "xid2"
    
   3、Then get the connection corresponding to xid from the connection pool to commit
   pool.getconnection("c1") --> xa commit "xid1"
   pool.getconnection("c2") -->  xa commit "xid2"
   ```
   
   This problem can be solved by opening multiple XA transactions through multiple connections.
   
   ### Usage Scenario
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] github-actions[bot] commented on issue #2859: [Dev][Jdbc connector] Support the session pool

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #2859:
URL: https://github.com/apache/incubator-seatunnel/issues/2859#issuecomment-1306415971

   This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] github-actions[bot] commented on issue #2859: [Dev][Jdbc connector] Support the session pool

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #2859:
URL: https://github.com/apache/incubator-seatunnel/issues/2859#issuecomment-1292809801

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] github-actions[bot] closed issue #2859: [Dev][Jdbc connector] Support the session pool

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #2859: [Dev][Jdbc connector] Support the session pool
URL: https://github.com/apache/incubator-seatunnel/issues/2859


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org