-
Couldn't load subscription status.
- Fork 41.6k
Description
When using Spring Boot 1.5.2 in Websphere 8.5.5.10, Sping Data Jpa autoconfiguration (i.e. class HibernateJpaAutoConfiguration) detects the WebSphere container and attempts to configure "JtaPlatformManager" using one of the following classes : org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform and org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform.
The latter is no longer existing in Hibernate 5 (seems to be cleaned out), so there is not point in referring to it in Spring Boot autoconfiguration. The former seems to be an incomplete implementation (many methods raise UnsupportedOperationException).
So when a transaction is rolled back, e.g. because of a bean validation constraint violation, an UnsupportedOperationException is raised instead of ConstraintViolationException.
A workaround is to replace the WebSphereExtendedJtaPlatform with org.hibernate.service.jta.platform.internal.WebSphereJtaPlatform, by the means of custom JPA properties (spring.jpa.properties.*) but I am not sure if it has side effects