PR Review: TRUNK-6541

Hi everyone,

I’ve submitted a PR for TRUNK-6541, fixing the UnexpectedRollbackException in AdministrationServiceImpl.validate().

PR: TRUNK-6541: Fix UnexpectedRollbackException by disabling transaction in validation by siddhantappuni-ops · Pull Request #5981 · openmrs/openmrs-core · GitHub JIRA: Jira

The issue was that the validate() method was running inside a transactional context (@Transactional(readOnly = true)), which meant that if a validator triggered a Hibernate session interaction or internal error, the transaction got marked as rollback-only. This caused an UnexpectedRollbackException to be thrown instead of the validation errors being properly returned in the Errors object.

I changed the annotation to @Transactional(propagation = Propagation.NOT_SUPPORTED) so that validation runs outside of any transaction. This way, validation failures are captured cleanly without triggering unintended rollbacks. Existing behaviour for valid inputs remains the same.

Quality Gate passed. Would appreciate a review.

@dkayiwa could you please take a look when you get a chance?

Thank you!