KamoCRM

Eager-load domains via findByIdWithDomains, drop @Transactional

FixSecurityService
Shipped
24 ஏப்ரல், 2026 அன்று 5:30 AM UTC
Author
Kamo
Commit
b6c8930

@Transactional on a controller method keeps a DB connection open across the entire MinIO upload, and also risks LazyInitializationException if the inner getOrganizationById transaction commits before resolvePrimaryDomain accesses org.getDomains(). Using findByIdWithDomains fetches domains in a single join query so no open session is needed during the upload.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing