Reputation: 7942
I am using:
The official documentation says you only have to set the jtaTransactionManager, and everything works:
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="atomikosDataSource" />
<property name="jtaTransactionManager" ref="jtaTransactionManager"/>
[...]
</bean>
Unfortuntely, the session is not flushed - no writes are taking place. What is the issue?
Upvotes: 4
Views: 4061
Reputation: 7942
The problem is that Hibernate 5 requires us to set the following property, which Spring doesn't do automatically yet:
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
[...]
<property name="hibernateProperties">
<props>
[...]
<prop key="hibernate.transaction.coordinator_class">jta</prop>
</props>
This fixed the issue for me.
Upvotes: 6