question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Let Hibernate configure the transaction manager on WebSphere

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
aguibertcommented, Aug 23, 2018

Hi, WebSphere/Liberty developer here. We contributed a new WebSphereLibertyJtaPlatform platform to Hibernate which is picked up as of version 5.2.13 and 5.3.Beta2. This new platform class allows Hibernate to fully integrate with the WebSphere transaction manager and does not throw any UOEs.

Unless Spring is explicitly setting the hibernate.transaction.jta.platform property, Hibernate is now capable of auto-detecting availability of the WebSphere transaction manager and using WebSphereLibertyJtaPlatform out of the box.

Further details here: https://hibernate.atlassian.net/browse/HHH-11571

0reactions
snicollcommented, Aug 24, 2018

After further investigation, I am changing my mind (see the analysis in #14194) and I’ll fix things only for the Websphere case for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JPA + websphere Cannot insert Record - hibernate
When you are using an TransactionManager from the Container you need to set the transaction-type to JTA .
Read more >
3.8. J2EE Application Server integration - JBoss.org
Simply lookup the SessionFactory from JNDI and get the current Session . Let Hibernate take care of flushing and closing the Session when...
Read more >
16. Transaction Management - Spring
It can work with JTA transactions or local transactions using JDBC, JPA, Hibernate or JDO by simply adjusting the configuration files. You can...
Read more >
3.8. J2EE Application Server integration - Linuxtopia
Simply lookup the SessionFactory from JNDI and get the current Session . Let Hibernate take care of flushing and closing the Session when...
Read more >
Support for Other Transaction Systems
Is IBM WebSphere Transaction Manager supported? Mostly. ... EhCacheRegionFactory supports Hibernate entities configured with <cache usage="transactional"/>.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found