Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
35430 214 d 2 h amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ Fix: Add @Transactional(readOnly = true) to DashboardController

Hibernate's getCurrentSession() requires a transaction context.
Using readOnly=true provides session context with optimizations:
- No row-level locks acquired
- DB can optimize for read-only queries
- Shorter connection hold time than read-write transactions
 
35429 214 d 2 h amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ Remove unnecessary @Transactional from DashboardController

- Removed class-level @Transactional(rollbackOn = Throwable.class)
- All 57 methods in this controller are read-only operations (dashboards, charts, reports)
- No transaction management needed for pure read operations
- Reduces unnecessary connection pool usage
 
35428 214 d 2 h amit /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/checkout/ Refactor OrderController: Move from class-level to method-level @Transactional

- Removed class-level @Transactional(rollbackFor = Throwable.class) from OrderController
- Added method-level @Transactional to 13 write methods only:
- createOrder (GET & POST)
- partnerCancelOrder
- CancellableRequest
- createAddress
- NotifyColorChange
- NotifyHold
- cancelOrder
- cancelNotifyOrder
- raiseBypassRequest
- createSamsungUpgradeOffer
- changeOrderPricing
- createInsurance

Benefits:
- 21 read-only methods no longer hold database connections for entire request duration
- Connections are acquired per-query and released immediately for reads
- Reduces connection pool exhaustion under load
- Follows "validate then transact" pattern
 
35427 214 d 3 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/ changeList  
35426 214 d 3 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ eol item remove from listing b2b (solr)  
35425 214 d 3 h aman /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix:Trial Mail For training and activation mail to user  
35424 214 d 3 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
 
35423 214 d 4 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Fixed  
35422 214 d 4 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/dtr/ Fixed  
35421 214 d 4 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ committed for query and testing for soler  
35420 214 d 7 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/ Fix LeadActivity scheduled time to use last updated schedule

- Added selectValueByMaxOfAnotherColumn method to GenericRepository
- Returns valueColumn from row with MAX of another column (e.g., createdTimestamp)
- Updated LeadRepositoryImpl to get schelduleTimestamp from most recently
created LeadActivity instead of MAX schelduleTimestamp
- Supports equalsMap filtering with DateRangeModel
 
35419 214 d 10 h aman /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ Fix:Response message for registered user  
35418 214 d 10 h aman /trunk/ Fix:Trial Mail For training and activation mail to user  
35417 214 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Fixed  
35416 215 d 4 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Fixed Long to Int  
35415 215 d 8 h amit /trunk/ Commit Changes  
35414 215 d 9 h amit /trunk/profitmandi-dao/src/main/resources/ Fixed performance  
35413 215 d 9 h amit /trunk/profitmandi-dao/src/main/resources/ Fixed performance  
35412 215 d 11 h amit /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ Fixed performance  
35411 215 d 12 h amit /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ Fixed performance issues  

Show All