-
Notifications
You must be signed in to change notification settings - Fork 695
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
feat: EXPOSED-555 Allow read-only suspendable transactions #2274
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this feature request @RenanKummer
Please consider rebasing from main
and addressing changes below.
This PR has been labelled feat!
but the BreakingChanges docs has not been updated. Given the default argument, the likeliness of using a statement
lambda, and our versioning, it would be fine to label feat
.
But if you're concerned about non-named arguments in the parameter list and wish to keep this label for thoroughness, then please also add a note under section 0.57.0 of the BreakingChanges doc.
exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/transactions/experimental/Suspended.kt
Outdated
Show resolved
Hide resolved
exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/postgresql/ConnectionPoolTests.kt
Outdated
Show resolved
Hide resolved
Regular transaction management allow callers to configure if new transactions should be read-only. This change adds the same behavior to suspendable transactions.
@bog-walk - Could you please review again? I applied the suggested changes. |
Description
Summary of the change: Regular transaction management allow callers to configure if new transactions should be read-only. This change adds the same behavior to suspendable transactions.
Detailed description:
readOnly
parameter has been added fornewSuspendTransaction
.readOnly
to be configured by callers. As per JetBrains Exposed documentation, this behavior is supposed to be the same for regular and suspendable transactions, but the parameter was missing for suspendable transactions.null
) to avoid breaking changes as much as possible. It is passed ahead to internal functions in order to create the transaction either as read-only based on caller's configuration or as the original behavior for existing code.Type of Change
Please mark the relevant options with an "X":
Updates/remove existing public API methods:
Affected databases:
Checklist
Related Issues
https://youtrack.jetbrains.com/issue/EXPOSED-555/newSuspendedTransaction-support-for-readOnly
EXPOSED-243