awaneetdecoder opened a new pull request, #5671:
URL: https://github.com/apache/fineract/pull/5671

   ## Problem
   The savings interest posting batch job could post duplicate interest 
   when two instances ran concurrently. PR #5550 attempted a fix but 
   adamsaghy correctly identified there was no rollback mechanism — 
   version mismatch was silently skipped.
   
   ## Fix
   - SQL uses WHERE id=? AND version=? to detect concurrent modification
   - version = version + 1 increments on each successful update
   - updateCounts[i] == 0 detected as concurrent modification
   - ConcurrentModificationException thrown on version mismatch
   - @Transactional on postInterest() rolls back entire batch
   
   ## Files Changed
   - SavingsAccountData.java — added version field
   - SavingsAccountReadPlatformServiceImpl.java — reads version from DB
   - SavingsSchedularInterestPoster.java — core fix
   - SavingsSchedularInterestPosterTest.java — unit tests
   - SavingsInterestPostingJobIntegrationTest.java — integration tests
   
   Fixes FINERACT-1659
   Supersedes PR #5550


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to