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 50 d 12 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 52 d 6 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Fixed MongoDB close method  
35330 71 d 11 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed loan issue  
35329 72 d 6 h ranu /trunk/ fix openinng stock  
35326 72 d 13 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Schedule Tasks  
35299 79 d 13 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Scheduled Task Logic  
35295 81 d 16 h amit /trunk/ Added reset logic  
35177 117 d 12 h amit /trunk/ Added SD Credit Scheduler  
35165 120 d 15 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Fixed system.exit(0)  
35160 120 d 18 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed SD Credit HardLimit Check  
35157 120 d 18 h amit /trunk/ Fixed SD Credit HardLimit Check  
35151 122 d 8 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ donotcommit  
35150 122 d 8 h vikas /trunk/ Oppo Sale Rewards Duration Wise  
35145 122 d 13 h amit /trunk/ Now minimum investment is changed dynamically based on total investment and limit utilized for retailers whose credit is marked as hard limit.  
35132 123 d 13 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Added scheduled Tasks  
35115 125 d 12 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35114 125 d 12 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35113 125 d 12 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35112 125 d 12 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35111 125 d 13 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  

Show All