-
Notifications
You must be signed in to change notification settings - Fork 48
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
Unexpected Transaction State Error on Repeated setReadOnly Calls in AWS Aurora Wrapper #1168
Comments
Thank you for the PR above, although it was submitted by someone not directly related to me. I wanted to talk over about this issue if this behavior was intended or not. And why |
Hi @erie0210 Thank you for reaching out and raising this issue. We'll take a look at this and keep you updated as we investigate. Would you be able to provide driver logs that shows a stack trace of the issue? As a possible solution for the reported issue, we can suggest to replace |
Thanks for the comment! @sergiyvamz Made sample app here:
stack trace:
While working on this, I found an issue, which I think might be related to this issue. #311
|
Hi @erie0210 , The fix is now available in the recently released v2.5.3 of the driver. Could you check it out let us know if the issue still persists? Thank you! |
I have checked it with the latest version, and everything is working properly. Thank you! @aaron-congo |
Great! In that case, I'll close this ticket. Let us know know if you have any further questions. Thanks! |
Describe the bug
In an environment using the AWS wrapper driver, we've encountered an intermittent error where calling
setReadOnly
at the start or end of a transaction triggers the Aurora wrapper's topology, resulting in the error: "Cannot change transaction read-only property in the middle of a transaction."Expected Behavior
If not strictly necessary, we recommend that the
setReadOnly
function should avoid executing the topology call, or that the topology function be executed only after the connection is fully established.What plugins are used? What other connection properties were set?
failover,efm
Current Behavior
Based on our direct analysis of the methods, we’ve inferred the following:
setReadOnly
method in JDBC cannot be called during a transaction.Given these points, we hypothesize that the error occurs in the following sequence:
TransactionState
changes toIDLE
.TransactionState
changes back toOPEN
.setReadOnly
method is called.Reproduction Steps
When the
setReadOnly
function is executed repeatedly, the error described above occasionally occurs.Possible Solution
I’d like to propose that the Aurora wrapper driver don't trigger the topology call by default when
setReadOnly
is invoked.Referencing the code in question: SubscribedMethodHelper.java, line 59.
Additional Information/Context
I'd be happy to create a PR to help fix this issue :)
The AWS Advanced JDBC Driver version used
2.2.3
JDK version used
correctto-17 17.0.9
Operating System and version
macOS 15.0.1 (24A348)
The text was updated successfully, but these errors were encountered: