Java Code Examples for org.springframework.jdbc.datasource.DataSourceTransactionManager#setDataSource()

The following examples show how to use org.springframework.jdbc.datasource.DataSourceTransactionManager#setDataSource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RoutingDataSourceAutoConfiguration.java    From n2o-framework with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public DataSourceTransactionManager routingTransactionManager(JndiRoutingDataSource routingDataSource) {
    DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
    transactionManager.setDataSource(routingDataSource);
    transactionManager.setDefaultTimeout(this.timeout);
    return transactionManager;
}
 
Example 2
Source File: BatchConfigurer.java    From CogStack-Pipeline with Apache License 2.0 5 votes vote down vote up
@Bean
public PlatformTransactionManager getJobRepoDataSourceTransactionManager(
        @Qualifier("jobRepositoryDataSource")
        DataSource jdbcDocumentTarget) {
    DataSourceTransactionManager tx = new DataSourceTransactionManager();
    tx.setDataSource(jdbcDocumentTarget);
    return tx;
}
 
Example 3
Source File: MybatisConfig.java    From SpringBoot-Study with Apache License 2.0 5 votes vote down vote up
/**
 * 配置事物管理器
 *
 * @return
 */
@Bean
public DataSourceTransactionManager transactionManager() {
    DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
    dataSourceTransactionManager.setDataSource(dataSource);
    return dataSourceTransactionManager;
}
 
Example 4
Source File: ClusterDruidDataSourceConfig.java    From SpringBoot-Study with Apache License 2.0 5 votes vote down vote up
/**
 * 配置事物管理器
 *
 * @return
 */
@Bean(name = "clusterTransactionManager")
public DataSourceTransactionManager clusterTransactionManager(
        @Qualifier("clusterDataSource") DataSource dataSource
) {
    DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
    dataSourceTransactionManager.setDataSource(dataSource);
    return dataSourceTransactionManager;
}
 
Example 5
Source File: MasterDruidDataSourceConfig.java    From SpringBoot-Study with Apache License 2.0 5 votes vote down vote up
/**
 * 配置事物管理器
 *
 * @return
 */
@Bean(name = "masterTransactionManager")
@Primary
public DataSourceTransactionManager masterTransactionManager(
        @Qualifier("masterDataSource") DataSource dataSource
) {
    DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
    dataSourceTransactionManager.setDataSource(dataSource);
    return dataSourceTransactionManager;
}
 
Example 6
Source File: Read1DruidDataSourceConfig.java    From SpringBoot-Study with Apache License 2.0 5 votes vote down vote up
/**
 * 配置事物管理器
 *
 * @return
 */
@Bean(name = "read1TransactionManager")
public DataSourceTransactionManager read1TransactionManager(
        @Qualifier("read1DataSource") DataSource dataSource
) {
    DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
    dataSourceTransactionManager.setDataSource(dataSource);
    return dataSourceTransactionManager;
}
 
Example 7
Source File: WriteDruidDataSourceConfig.java    From SpringBoot-Study with Apache License 2.0 5 votes vote down vote up
/**
 * 配置事物管理器
 *
 * @return
 */
@Bean(name = "writeTransactionManager")
public DataSourceTransactionManager writeTransactionManager(
        @Qualifier("writeDataSource") DataSource dataSource
) {
    DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
    dataSourceTransactionManager.setDataSource(dataSource);
    return dataSourceTransactionManager;
}
 
Example 8
Source File: Read2DruidDataSourceConfig.java    From SpringBoot-Study with Apache License 2.0 5 votes vote down vote up
/**
 * 配置事物管理器
 *
 * @return
 */
@Bean(name = "read2TransactionManager")
public DataSourceTransactionManager read2TransactionManager(
        @Qualifier("read2DataSource") DataSource dataSource
) {
    DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
    dataSourceTransactionManager.setDataSource(dataSource);
    return dataSourceTransactionManager;
}
 
Example 9
Source File: DataSourceConfig.java    From x7 with Apache License 2.0 5 votes vote down vote up
@Bean
public PlatformTransactionManagerCustomizer platformTransactionManagerCustomizer(AbstractRoutingDataSource abstractRoutingDataSource){
    return transactionManager -> {
        DataSourceTransactionManager dataSourceTransactionManager = (DataSourceTransactionManager) transactionManager;
        dataSourceTransactionManager.setDataSource(abstractRoutingDataSource);
    };
}
 
Example 10
Source File: RootConfig.java    From PedestrianDetectionSystem with Apache License 2.0 5 votes vote down vote up
@Override
    @Bean(name = "annotationDrivenTransactionManager")
    public PlatformTransactionManager annotationDrivenTransactionManager() {
        DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
        transactionManager.setDataSource(initDataSource());
        return transactionManager;
}
 
Example 11
Source File: ActivitiEngineConfiguration.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager() {
  DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
  transactionManager.setDataSource(dataSource());
  return transactionManager;
}
 
Example 12
Source File: ActivitiEngineConfiguration.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager() {
  DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
  transactionManager.setDataSource(dataSource());
  return transactionManager;
}
 
Example 13
Source File: DataSourceConfigurationTest.java    From mycollab with GNU Affero General Public License v3.0 4 votes vote down vote up
@Bean
public DataSourceTransactionManager txManager() {
    DataSourceTransactionManager bean = new DataSourceTransactionManager();
    bean.setDataSource(dataSource());
    return bean;
}
 
Example 14
Source File: DruidDataSourceConfig.java    From code with Apache License 2.0 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager() throws Exception {
	DataSourceTransactionManager txManager = new DataSourceTransactionManager();
	txManager.setDataSource(dataSource());
	return txManager;
}
 
Example 15
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager(DataSource dataSource) {
    DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
    transactionManager.setDataSource(dataSource);
    return transactionManager;
}
 
Example 16
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager(DataSource dataSource) {
    DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
    transactionManager.setDataSource(dataSource);
    return transactionManager;
}
 
Example 17
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager(DataSource dataSource) {
    DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
    transactionManager.setDataSource(dataSource);
    return transactionManager;
}
 
Example 18
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager(DataSource dataSource) {
    DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
    transactionManager.setDataSource(dataSource);
    return transactionManager;
}
 
Example 19
Source File: EngineConfiguration.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager(DataSource dataSource) {
    DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
    transactionManager.setDataSource(dataSource);
    return transactionManager;
}
 
Example 20
Source File: AppConfig.java    From sequenceiq-samples with Apache License 2.0 4 votes vote down vote up
@Bean
public DataSourceTransactionManager createDataSourceTransactionManager() {
    DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
    dataSourceTransactionManager.setDataSource(dataSource());
    return dataSourceTransactionManager;
}