Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Show changed files | Details | Compare with Previous | Blame | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
35424 303 d 10 h amit /trunk/ Fix order billing vs cancellation race condition with pessimistic locking

Problem:
- Concurrent billing and cancellation of the same order caused data inconsistency
- Money was refunded to wallet while order was also getting billed

Solution:
- Added pessimistic locking (SELECT FOR UPDATE) to prevent concurrent modifications
- Added validation methods to check order state before billing/cancellation
- Optimized billing method to reduce lock duration with pre-fetching

Changes:
- OrderRepository: Added selectByIdForUpdate, selectByOrderIdsForUpdate,
selectByInvoiceNumbersForUpdate, selectAllByTransactionIdForUpdate,
validateOrdersForBilling, validateOrderForRefund methods
- OrderRepositoryImpl: Implemented locking methods with PESSIMISTIC_WRITE
- TransactionServiceImpl: Updated billing methods with locking, fail-fast
validation, pre-fetching to avoid N+1 queries
- ScheduledTasks: Updated removePartialBillingForTransaction with locking
- TransactionRelatedTasks: Updated reverseRTO with locking
 
35393 305 d 4 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Fixed MongoDB close method  
35361 312 d 11 h aman /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Feat:Trial user mails for pending Verification and store code  
35358 312 d 16 h ranu /trunk/ eol item remove from listing b2b (solr)  
35330 324 d 9 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed loan issue  
35329 325 d 4 h ranu /trunk/ fix openinng stock  
35326 325 d 11 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Schedule Tasks  
35299 332 d 11 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Scheduled Task Logic  
35295 334 d 15 h amit /trunk/ Added reset logic  
35277 339 d 12 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Migrations  
35276 339 d 12 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Migrations  
35267 341 d 13 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ without invoice cancel request  
35266 341 d 13 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ without invoice cancel request  
35265 341 d 13 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Migrations  
35250 351 d 11 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Migrations  
35239 354 d 16 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ bi report exception  
35238 354 d 16 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ bi report exception  
35237 354 d 16 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ bi report exception  
35179 370 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/migrations/ Added SD Credit Scheduler  
35178 370 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Added SD Credit Scheduler  

Show All