- Shipped
- September 5, 2026 at 6:40 PM UTC
- Author
- Kamo
- Commit
- 69ce83b
The submit handler is @Transactional, and it was calling EmailService inline — blocking HTTP into blocking SMTP with a 30-second read timeout, while holding a database connection and an open Yugabyte snapshot. Under any load that exhausts the Hikari pool, and it widens the 40001-restart window on a transaction that has already finished its work. Sending BEFORE the commit is its own bug: a receipt quoting a reference number for a lead whose insert then rolls back leaves the borrower with a number nobody can find, and every one of those reaches the lender as a complaint. So the variables are built where they must be — inside the transaction, while the entities are attached and readable — and the network call is registered for afterCommit. The callback closes over nothing but Strings. Also carries the borrower's first-time-buyer answer through to the lead.