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
35433 27 d 8 h amit /trunk/profitmandi-fofo/ Add @Transactional(readOnly=true) to read-only controllers for performance

Updated 11 controllers that only perform read operations:
- AnalysisDashboardController, InvoiceController, ItemLedgerController
- MapTrackController, MarginController, MongoMigrationController
- PartnerPendingTasksController, PostOfficeController, ScanRecordController
- LogixController, MonitorController

Benefits:
- Hibernate skips dirty checking (faster)
- Database can optimize for read-only queries
- Connection marked as read-only for potential read replica routing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
 
35432 27 d 10 h amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ Remove @Transactional from DashboardController

Transaction management now handled at repository level (GenericRepositoryImpl).
Controllers no longer need @Transactional annotation.
 
35431 27 d 10 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/ Add @Transactional at repository level for proper session management

- Added @Transactional(readOnly=true) at class level for all read operations
- Added @Transactional on write methods: persist, delete, deleteById,
deleteByEquals, deleteByEqual, updateById, updateByEquals, deleteAll

Benefits:
- Repository layer owns transaction management (architecturally correct)
- Read operations skip dirty checking (performance optimization)
- Shortest connection hold time per repository call
- Controllers no longer need @Transactional annotation
- Enables database read optimizations (read replicas, skip WAL)
 
35430 27 d 10 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 27 d 10 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 27 d 10 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 27 d 10 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/ changeList  
35426 27 d 10 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ eol item remove from listing b2b (solr)  
35425 27 d 10 h aman /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix:Trial Mail For training and activation mail to user  
35424 27 d 11 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 27 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Fixed  
35422 27 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/dtr/ Fixed  
35421 27 d 11 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ committed for query and testing for soler  
35420 27 d 14 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 27 d 17 h aman /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ Fix:Response message for registered user  
35418 27 d 17 h aman /trunk/ Fix:Trial Mail For training and activation mail to user  
35417 27 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Fixed  
35416 28 d 12 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Fixed Long to Int  
35415 28 d 15 h amit /trunk/ Commit Changes  
35414 28 d 16 h amit /trunk/profitmandi-dao/src/main/resources/ Fixed performance  

Show All