Subversion Repositories SmartDukaan

Rev

Show changed files | Details | Compare with Previous | Blame | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37361 48 d 2 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Mail outbox: one transaction per mail, retry once more, stable Message-ID

processPendingMails ran the whole batch in a single REQUIRES_NEW transaction, so a
crash mid-batch rolled back the status of every mail already delivered in that cycle
and the next run re-sent them.

- Split into selectPendingIds (read-only) plus sendOne per mail, each REQUIRES_NEW via
a @Lazy self-reference so the proxy actually applies. Outcome is committed as soon
as it is known; a crash now loses at most the mail in flight.
- MailOutbox.selectPending retries FAILED rows once more (retryCount < 2).
- Stable per-row Message-ID so a retry arrives as the same message and the receiving
server can collapse it instead of showing a duplicate.
 
36250 177 d 15 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Sender-type-aware mail cleanup: 6 months for SendGrid/Relay, 1 month for Google SMTP  
35956 213 d 10 h amit /trunk/profitmandi-dao/src/main/ Mail outbox pattern: persist mail in transaction, send async after commit. Fixes lock contention between /cancelOrder and /om/addBillingDetailsForGrouppedOrders caused by SMTP calls inside transactions holding DB locks.