So in the latest version of Spring we are able to use the @Configuration
annotation to setup our configurations for Spring. Now in JavaConfig it is possible to use the @AnnotationDrivenTx
(@AnnotationDrivenTx Reference Link) annotation to setup transactions in our Config class. But since JavaConfig has been decommissioned I was wondering if anyone knew how to setup something similar without JavaConfig and without needing to add anything to the application-context.xml
. Here is what I basically have for my Config class
@Configuration
@ImportResource("config/application-context.xml")
public class Config {
public @Bean DataSource dataSource() {
//get and return datasource
}
public @Bean Service1 getService1() {
//return service1Impl
}
}
And I'd like to make Service1
transactional. If anyone has any ideas on how to do this or if this is just not possible please let me know.
Thanks!