Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement]: Improve Ballerina transactions with XA Resource connection check/refresh before commit, rollback operations #41933

Open
dsplayerX opened this issue Jan 4, 2024 · 0 comments
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Improvement

Comments

@dsplayerX
Copy link
Contributor

Description

XAResource is actually a connection to the back-end-resource (such as JDBC or JMS) and this connection needs to stay open during transactions as this connection is regularly used within a 2PC transaction. This connection can break due to network timeouts, failures and the back-end server crashes. A mechanism to check whether the connection is active and if not then re-establish the connection before commit, rollback operations can minimize transaction failures.

Describe your problem(s)

In Ballerina Transactions, the current implementation lacks a check for an active connection to a XA Resource before the prepare, commit/rollback calls. If a network failure, network timeout or a backend crash interrupts the connection between the application program and the XA Resource prior to commit/rollback operations, these calls on the XA Resource would proceed without validating the connection status leaving transactions in hazard states.

Describe your solution(s)

The proposed solution involves implementing a mechanism to check and refresh XA Resource connection if needed within Ballerina Transactions. This will serve as a preemptive check to verify the status of the XA Resource connection before the commit, rollback operations. If any connection is found to be broken or unstable, this will ensure that the connection is re-established before initiating the commit, thereby ensuring the transaction's integrity, minimizing transaction failures caused by connection failures.

Related area

-> Runtime

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added the Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime label Jan 4, 2024
@dsplayerX dsplayerX added Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. and removed Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime labels Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Improvement
Projects
None yet
Development

No branches or pull requests

2 participants