fix!: EXPOSED-1076 Preserve transaction cleanup failures - #2935
Open
Devksh930 (devksh930) wants to merge 1 commit into
Open
Devksh930 (devksh930) wants to merge 1 commit into
Devksh930 (devksh930) wants to merge 1 commit into
Conversation
Attach caught rollback and resource-close exceptions to the primary transaction failure in JDBC and R2DBC, preserving cleanup order and existing retry behavior. Cover statement execution, retry, nested transactions, cancellation, connection initialization, and successful-transaction cleanup with regression tests. Document the direct-close behavior change. BREAKING CHANGE: Direct R2dbcConnectionImpl.close() calls, and manually managed R2dbcTransaction.close() calls that release the underlying connection, now propagate driver close failures instead of only logging them. Transaction helpers continue to log cleanup-only failures after a successful transaction without changing its result.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of the change: Preserve caught transaction cleanup exceptions as suppressed exceptions on the primary failure in JDBC and R2DBC.
Detailed description:
Statement.execute()publisher error and exactly-once cleanup assertions.Compatibility: Direct
R2dbcConnectionImpl.close()calls now propagate driver close failures. This also affects manually managedR2dbcTransaction.close()calls that release the underlying connection. The change is marked as breaking and documented in KDoc andBreaking-Changes.md. Public API signatures are unchanged.Related work: #2320 already preserves connection-initialization cleanup failures with
addSuppressedon the JDBC side. This change extends diagnostic preservation to transaction cleanup and builds on the cancellation-safe release path from #2843. The direct R2DBC close behavior change may also be relevant to the Spring reactive transaction manager work in #2685 and #2886; those branches are outside this PR's tested scope.Validation:
023a6a3a7with this patch: H2 regression tests 38 passed (JDBC 22, R2DBC transaction 13, R2DBC connection 3); rootdetektand rootapiCheckpassed.023a6a3a7because the suppressed list is empty, and passes with the production patch.0e4d81a58, before the publisher regression was added: full H2 JDBC 894 passed / 161 skipped; full H2 R2DBC 801 passed / 171 skipped; focused PostgreSQL 36 passed / 1 H2-only test skipped. These full suites and PostgreSQL results have not been refreshed on the new DAO merge.Coroutine stacktrace recovery may independently copy exceptions. Test exception types prevent those copies to isolate Exposed's suppression behavior; this change does not modify coroutine stacktrace recovery.
Type of Change
Updates/remove existing public API methods:
Affected databases (shared transaction code; local driver validation is listed above):
Checklist
Related Issues
https://youtrack.jetbrains.com/issue/EXPOSED-1076