If you really need to do it in separate transaction you need to use REQUIRES_NEW
and live with the performance overhead. Watch out for dead locks.
I'd rather do it the other way:
- Validate data on Java side.
- Run everyting in one transaction.
- If anything goes wrong on DB side -> it's a major error of DB or validation design. Rollback everything and throw critical top level error.
- Write good unit tests.