Commit 30351c62 authored by Stephane Nicoll's avatar Stephane Nicoll

Provide native JtaTransactionManager when applicable

This commit updates JndiJtaConfiguration to provide the same detection
algorithm as <tx:jta-transaction-manager>. If a native JTA transaction
manager exists for the current platform, it is used instead of the regular
JtaTransactionManager implementation.

Fixes gh-1576
parent 64ef03aa
......@@ -22,6 +22,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.config.JtaTransactionManagerFactoryBean;
import org.springframework.transaction.jta.JtaTransactionManager;
/**
......@@ -40,7 +41,8 @@ class JndiJtaConfiguration {
@Bean
public JtaTransactionManager transactionManager() {
return new JtaTransactionManager();
JtaTransactionManagerFactoryBean factoryBean = new JtaTransactionManagerFactoryBean();
return factoryBean.getObject();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment