FINERACT-2406: Transaction reprocessing fix - #5143
Conversation
| private final FlushModeHandler flushModeHandler; | ||
|
|
||
| @Around("@within(withFlushMode) || @annotation(withFlushMode)") | ||
| public Object manageFlushMode(ProceedingJoinPoint joinPoint, WithFlushMode withFlushMode) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
bacc58f to
49c4b30
Compare
49c4b30 to
3983d9a
Compare
COMMIT flush mode during transaction processing23e2b06 to
229b39b
Compare
229b39b to
f6c33ed
Compare
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!
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.