Skip to content

fix: EXPOSED-754 Fix global rollback mark not set on unchecked exception in spring transaction#2453

Merged
bog-walk merged 5 commits intoJetBrains:mainfrom
zbqmgldjfh:zbqmgldjfh/exposed-754
Dec 14, 2025
Merged

fix: EXPOSED-754 Fix global rollback mark not set on unchecked exception in spring transaction#2453
bog-walk merged 5 commits intoJetBrains:mainfrom
zbqmgldjfh:zbqmgldjfh/exposed-754

Conversation

@zbqmgldjfh
Copy link
Contributor

@zbqmgldjfh zbqmgldjfh commented Apr 1, 2025

Description

Summary of the change:

  • Added a property isRollback managed by TransactionScope in an individual transaction. : SpringTransactionManager
  • Add more test : SpringTransactionRollbackTest

Detailed description:

  • What: Global rollback mark not properly set on Unchecked Exception in Spring Transaction
    tx_flow

  • Why: The issue arises when a method with a transaction is called more than once in a nested manner.
    In this case, the results from the inner transactions are not being propagated to the outer one.
    However, in Spring, it is the default behavior to mark the entire transaction for rollback.
    Even if the exception is caught using a try-catch block, the rollback mark remains.

image (1)
  • How: Add a simple isRollback property for Tx

Type of Change

Please mark the relevant options with an "X":

  • Bug fix
  • New feature
  • Documentation update

Updates/remove existing public API methods:

  • Is breaking change

Affected databases:

  • MariaDB
  • Mysql5
  • Mysql8
  • Oracle
  • Postgres
  • SqlServer
  • H2
  • SQLite

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs
  • Documentation for my change is up to date

Related Issues

https://youtrack.jetbrains.com/issue/EXPOSED-754/Global-Rollback-Mark-Not-Properly-Set-on-Unchecked-Exception-in-Spring-Transaction

@zbqmgldjfh zbqmgldjfh changed the title fix: EXPOSED-754 Fix Global Rollback Mark Not Set on Unchecked Exception in Spring Transaction fix: EXPOSED-754 Fix global rollback mark not set on unchecked exception in spring transaction Apr 2, 2025
@bog-walk bog-walk force-pushed the zbqmgldjfh/exposed-754 branch from 6a2bf58 to 24b2145 Compare December 13, 2025 05:03
@bog-walk bog-walk self-assigned this Dec 13, 2025
@bog-walk bog-walk self-requested a review December 13, 2025 05:04
Copy link
Member

@bog-walk bog-walk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for recognizing this issue, the thorough PR, and pushing a fix @zbqmgldjfh !

@bog-walk bog-walk merged commit 635fda7 into JetBrains:main Dec 14, 2025
4 checks passed
@zbqmgldjfh
Copy link
Contributor Author

zbqmgldjfh commented Dec 15, 2025

Thank you for reviewing and merging the PR @bog-walk !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants