Bypass JPA org lookup to avoid Hibernate cascade flush error

FixSecurityService
Shipped
April 18, 2026 at 7:26 PM UTC
Author
Kamo
Commit
f4123e8

**************** triggers **************** which causes a Hibernate auto-flush. That flush fails because Organization.features was previously replaced with a plain List (cascade=all-delete-orphan violation). The resendVerification endpoint only needs the org ID, so replace the JPA call with a plain jdbcTemplate query — the same pattern already used for user lookup in this method.

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