Eager-load domains via findByIdWithDomains, drop @Transactional

FixSecurityService
Shipped
April 24, 2026 at 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?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing