use of org.springframework.jdbc.datasource.DataSourceTransactionManager in project spring-boot by spring-projects.
the class DataSourceTransactionManagerAutoConfigurationTests method testCustomizeDataSourceTransactionManagerUsingProperties.
@Test
public void testCustomizeDataSourceTransactionManagerUsingProperties() throws Exception {
EnvironmentTestUtils.addEnvironment(this.context, "spring.transaction.default-timeout:30", "spring.transaction.rollback-on-commit-failure:true");
this.context.register(EmbeddedDataSourceConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, TransactionAutoConfiguration.class);
this.context.refresh();
DataSourceTransactionManager transactionManager = this.context.getBean(DataSourceTransactionManager.class);
assertThat(transactionManager.getDefaultTimeout()).isEqualTo(30);
assertThat(transactionManager.isRollbackOnCommitFailure()).isTrue();
}
use of org.springframework.jdbc.datasource.DataSourceTransactionManager in project camel by apache.
the class SqlTransactedRouteTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry reg = super.createRegistry();
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).build();
reg.bind("testdb", db);
DataSourceTransactionManager txMgr = new DataSourceTransactionManager();
txMgr.setDataSource(db);
reg.bind("txManager", txMgr);
SpringTransactionPolicy txPolicy = new SpringTransactionPolicy();
txPolicy.setTransactionManager(txMgr);
txPolicy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
reg.bind("required", txPolicy);
return reg;
}
use of org.springframework.jdbc.datasource.DataSourceTransactionManager in project Activiti by Activiti.
the class ActivitiEngineConfiguration method annotationDrivenTransactionManager.
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager() {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
transactionManager.setDataSource(dataSource());
return transactionManager;
}
use of org.springframework.jdbc.datasource.DataSourceTransactionManager in project Activiti by Activiti.
the class ActivitiEngineConfiguration method annotationDrivenTransactionManager.
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager() {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
transactionManager.setDataSource(dataSource());
return transactionManager;
}
use of org.springframework.jdbc.datasource.DataSourceTransactionManager in project Activiti by Activiti.
the class ActivitiEngineConfiguration method annotationDrivenTransactionManager.
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager() {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
transactionManager.setDataSource(dataSource());
return transactionManager;
}
Aggregations