JndiDataSourceLookup非XA数据源

时间:2019-03-10 16:57:50

标签: spring hibernate spring-boot spring-data-jpa wildfly

我将Spring引导应用程序上载到wildfly,我注意到扩展CrudRepository的每个接口均不起作用,并且引发了异常

“您无法在托管交易中设置自动提交”例外

经过一些研究,我发现问题可能出在XA和非XA数据源上,因为我使用单个数据库,所以我需要具有非XA配置(我在wildfly上具有),但是我不知道是否存在应该添加到Java应用中的任何内容

@Bean(name = "dataSource")
@Profile("prod") // profile used when creating WAR file
public DataSource jndiDataSource() {
    return new JndiDataSourceLookup()
            .getDataSource(env.getProperty("docManage.jndi"));
}

这是jndi网址java:/ docManagementDatabase

预先感谢

0 个答案:

没有答案
相关问题