Skip to content

FINERACT-2406: Transaction reprocessing fix - #5143

Merged
adamsaghy merged 2 commits into
apache:developfrom
openMF:FINERACT-2406/use-commit-flush-mode-during-reprocessing
Nov 6, 2025
Merged

FINERACT-2406: Transaction reprocessing fix#5143
adamsaghy merged 2 commits into
apache:developfrom
openMF:FINERACT-2406/use-commit-flush-mode-during-reprocessing

Conversation

@adamsaghy

Copy link
Copy Markdown
Contributor

Description

Describe the changes made and why they were made.

Ignore if these details are present on the associated Apache Fineract JIRA ticket.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

private final FlushModeHandler flushModeHandler;

@Around("@within(withFlushMode) || @annotation(withFlushMode)")
public Object manageFlushMode(ProceedingJoinPoint joinPoint, WithFlushMode withFlushMode) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there's one thing missing from this. Whether the annotation is applied to a class/method which is inside a running transaction (IIRC you can use the TransactionSynchronizationManager to check this).

Also, one thing that comes to my mind when combining these kind of things (Transactional and this annotation) is the ordering.

You need to make sure the ordering of this aspect is lower than the transactional annotation's, otherwise you might apply this first then the tx annotation.

@adamsaghy adamsaghy Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I accept the transactionSynchronizationManager one, but i dont think we should mess with the orders. In case "Transactional" annotation is used alongside with WithFlushMode, the only important to use Transactional first.

By default Transactional annotation is using Spring default ordering which is LOWEST_PRECEDENCE, alongside with Retry, Cacheable, etc. which also using this. If i am changing it to use LOWEST_PRECEDENCE-1, it might break all those logic: having retry inside transaction boundary, etc.

@adamsaghy
adamsaghy force-pushed the FINERACT-2406/use-commit-flush-mode-during-reprocessing branch 3 times, most recently from bacc58f to 49c4b30 Compare November 5, 2025 20:57
@adamsaghy
adamsaghy force-pushed the FINERACT-2406/use-commit-flush-mode-during-reprocessing branch from 49c4b30 to 3983d9a Compare November 6, 2025 08:53
@adamsaghy adamsaghy changed the title FINERACT-2406: Set COMMIT flush mode during transaction processing FINERACT-2406: Transaction reprocessing fix Nov 6, 2025
@MarianaDmytrivBinariks
MarianaDmytrivBinariks force-pushed the FINERACT-2406/use-commit-flush-mode-during-reprocessing branch from 23e2b06 to 229b39b Compare November 6, 2025 17:43
@MarianaDmytrivBinariks
MarianaDmytrivBinariks force-pushed the FINERACT-2406/use-commit-flush-mode-during-reprocessing branch from 229b39b to f6c33ed Compare November 6, 2025 17:47
@adamsaghy
adamsaghy merged commit d269cb9 into apache:develop Nov 6, 2025
33 checks passed
@adamsaghy
adamsaghy deleted the FINERACT-2406/use-commit-flush-mode-during-reprocessing branch November 6, 2025 20:13
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.

5 participants