# springboot无配置多数据源分布式数据事务管理

## 使用atomikos解决多数据源分布式事务问题

atomikos官网是这样描述atomikos的使用的：

It is easy to setup by using its setter methods but can also be easily built from a Spring BeanFactory. Here is an example of code that creates an AtomikosDataSourceBean with 5 connections in pool on an Oracle database:

AtomikosDataSourceBean ds = new AtomikosDataSourceBean();
ds.setUniqueResourceName(“oracle”);
Properties p = new Properties();
p.setProperty ( “user” , “java” );
p.setProperty ( “password” , “java” );
p.setProperty ( “URL” , “jdbc:oracle:thin:@localhost-xe:1521:XE” );
ds.setPoolSize ( 5 );





`