So after a big refactoring project, I am left with this exception and am unsure as how to correct it. It\'s dealing with some code that I did not write and I am unfamiliar w
Use WebSphereTransactionManagerLookup
for the transaction manager lookup in Hibernate
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereTransactionManagerLookup" />
and remove your current transaction manager and replace it with the WebSphereUowTransactionManager
.
<tx:annotation-driven/>
<bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager"/>
for your transaction manager lookup in Spring.
See IBM Websphere and Spring docs for more in depth documentation.
The problem is your configuration. You have hibernate configured for JTA.
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" />
Whereas you are using local transactions instead of distributed transactions.
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:380)
You have 2 possible solutions
JpaTransactionManager
and replace it with a JTA transaction managerhibernate.transaction.manager_lookup_class
from the hibernate settings.If you don't really need distributed transactions option 2 is the easiest, if you need distributed transactions simply adding <tx:jta-transaction-manager />
will setup a proper JTA tx manager for your environment. Remove the definition for the JpaTransactionManager
.
Update:
Your configuration is flawed in 2 ways.
<tx:jta-transaction-manager />
and JpaTransactionManager
which one do you want to use? At the moment the latter is overriding the first one.Create 2 seperate configurations one for local testing and one for production using JTA en JNDI lookups. (Preferable your testing code only overrides the beans necessary).