-
Notifications
You must be signed in to change notification settings - Fork 117
FQA
lorne edited this page Nov 3, 2017
·
3 revisions
- TxManager为什么启动时会有错误?
启动过程中可能会发现一些异常,是由于eureka的启动顺序导致的,可以忽略。只要确保redis配置正确,且可访问index界面即可。
- TxManager服务能不能使用自己搭建的eureka服务?
可以的,不过需要调整一下TxManager代码。如下:
修改启动注解
修改获取地址
- 启动的时候报Consider defining a bean of type 'com.lorne.tx.db.IBaseProxy' in your configuration.错误?
将DataSource对象改为LCNDataSourceProxy,如下:
@Bean
public LCNDataSourceProxy dataSource() {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setUrl(env.getProperty("spring.datasource.url"));
dataSource.setUsername(env.getProperty("spring.datasource.username"));//用户名
dataSource.setPassword(env.getProperty("spring.datasource.password"));//密码
dataSource.setInitialSize(2);
dataSource.setMaxActive(20);
dataSource.setMinIdle(0);
dataSource.setMaxWait(60000);
dataSource.setValidationQuery("SELECT 1");
dataSource.setTestOnBorrow(false);
dataSource.setTestWhileIdle(true);
dataSource.setPoolPreparedStatements(false);
LCNDataSourceProxy dataSourceProxy = new LCNDataSourceProxy();
dataSourceProxy.setDataSource(dataSource);
//分布式事务参与的最大连接数,确保不要超过普通连接池的最大值即可
dataSourceProxy.setMaxCount(10);
return dataSourceProxy;
}
© 2017 lorne team