Marten/adrianshum
Thanks for the posts, this one had me confused for a few minutes. I just wanted to add if you are using the classpath scanning on the LocalContainerEntityManagerFactoryBean that is fine just make sure you set the JtaDatasource, not the DataSource
Code:
@Bean
public LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean()
{
LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
lef.setJtaDataSource(datasource());
lef.setPackagesToScan("com.xxx.yyy.model.entity");
lef.setJpaProperties(jpaProperties());
lef.setJpaVendorAdapter(jpaVendorAdapter());
return lef;
}