本文整理汇总了Java中org.springframework.jdbc.datasource.DataSourceTransactionManager.setDataSource方法的典型用法代码示例。如果您正苦于以下问题:Java DataSourceTransactionManager.setDataSource方法的具体用法?Java DataSourceTransactionManager.setDataSource怎么用?Java DataSourceTransactionManager.setDataSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.jdbc.datasource.DataSourceTransactionManager
的用法示例。
在下文中一共展示了DataSourceTransactionManager.setDataSource方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read2TransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "read2TransactionManager")
public DataSourceTransactionManager read2TransactionManager(
@Qualifier("read2DataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例2: writeTransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "writeTransactionManager")
public DataSourceTransactionManager writeTransactionManager(
@Qualifier("writeDataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例3: read1TransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "read1TransactionManager")
public DataSourceTransactionManager read1TransactionManager(
@Qualifier("read1DataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例4: masterTransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "masterTransactionManager")
@Primary
public DataSourceTransactionManager masterTransactionManager(
@Qualifier("masterDataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例5: clusterTransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "clusterTransactionManager")
public DataSourceTransactionManager clusterTransactionManager(
@Qualifier("clusterDataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例6: cluster1TransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
/**
* 配置事物管理器
*
* @return
*/
@Bean(name = "cluster1TransactionManager")
public DataSourceTransactionManager cluster1TransactionManager(
@Qualifier("cluster1DataSource") DataSource dataSource
) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例7: transactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
/**
* 配置事物管理器
*
* @return
*/
@Bean
public DataSourceTransactionManager transactionManager() {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
示例8: create
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
public DataSourceTransactionManager create() {
DataSourceTransactionManager dm = new DataSourceTransactionManager();
dm.setDataSource((DataSource) getContext().getBean(DataSourceBox.class));
return dm;
}
示例9: getTransactionManager
import org.springframework.jdbc.datasource.DataSourceTransactionManager; //导入方法依赖的package包/类
@Bean
public DataSourceTransactionManager getTransactionManager() {
DataSourceTransactionManager txManager = new DataSourceTransactionManager();
txManager.setDataSource(getDataSource());
return txManager;
}