<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SmartDukaan &#x2013; /trunk/profitmandi-dao/src/main/resources/sql/add_uk_fofo_order_fofo_invoice.sql</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Wed, 06 May 2026 15:13:33 +0530</lastBuildDate><generator>WebSVN 2.8.6-DEV</generator><language>en</language><link>https://svn.smartdukaan.com/log.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fadd_uk_fofo_order_fofo_invoice.sql&amp;max=40&amp;</link><atom:link href="https://svn.smartdukaan.com/rss.php?path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fadd_uk_fofo_order_fofo_invoice.sql&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<item><pubDate>Wed, 22 Apr 2026 19:49:38 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 36362 – Make fofo_order creation idempotent on (fofo_id, invoice_number)  Fixes insert-intention ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;Make fofo_order creation idempotent on (fofo_id, invoice_number)&lt;br /&gt;
&lt;br /&gt;
Fixes insert-intention gap-lock deadlocks on idx_invoice_number observed in&lt;br /&gt;
SHOW ENGINE INNODB STATUS at 2026-04-22 13:01:54 — two concurrent requests&lt;br /&gt;
inserting the same invoice_number for the same customer (client retry /&lt;br /&gt;
upstream webhook retry pattern).&lt;br /&gt;
&lt;br /&gt;
- OrderServiceImpl.createAndGetFofoOrder: select-then-insert idempotency.&lt;br /&gt;
  Fast path returns existing row if already created; slow-race path catches&lt;br /&gt;
  DataIntegrityViolationException and re-selects the winner&apos;s row.&lt;br /&gt;
- add_uk_fofo_order_fofo_invoice.sql: adds UNIQUE KEY (fofo_id, invoice_number)&lt;br /&gt;
  so the loser of a concurrent-insert race gets a clean DIVE instead of a&lt;br /&gt;
  silent duplicate row (pre-check showed zero existing dup groups, safe).&lt;br /&gt;
&lt;br /&gt;
findExistingFofoOrder wraps the repo call to swallow the repo&apos;s declared&lt;br /&gt;
ProfitMandiBusinessException — the impl actually returns null on not-found&lt;br /&gt;
(constructs an exception but never throws), so the swallow matches reality.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/order/OrderServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/add_uk_fofo_order_fofo_invoice.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fadd_uk_fofo_order_fofo_invoice.sql&amp;rev=36362</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fadd_uk_fofo_order_fofo_invoice.sql&amp;rev=36362</guid></item>
</channel></rss>