(root)/ – Rev 36340
Rev 36339 |
Last modification |
Compare with Previous |
View Log
| RSS feed
Last modification
- Rev 36340 2026-04-22 12:14:58
- Author: amit
- Log message:
- Narrow downloadInvoice: release JDBC before PDF streaming + clean error codes
OrderManagementController has class-level @Transactional(rollbackFor=Throwable),
so every downloadInvoice request held a Hikari connection for the entire HTTP
response duration — including the PDF streaming phase over a user's (often
slow) mobile network. The endpoint is the #1 JDBC-slot holder in production.
- Method-level @Transactional(propagation = NOT_SUPPORTED) suspends the
class-level tx for this endpoint so no connection is held by default.
- A short read-only TransactionTemplate scopes the single SELECT (order lookup
by invoice number) inside its own tx. Connection returns to the pool as soon
as the SELECT commits; file streaming then runs without any JDBC session.
- Bounds-check orders.isEmpty() — 2 IndexOutOfBoundsException per log window
previously, now a clean 404 with message body.
- Invoice-not-yet-generated stops surfacing as a 500 with stack trace
(1,534 occurrences in yesterday's log = #1 noise source). Now a 404 with
'please retry shortly' JSON body. Saves log disk and error-budget.