mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
refactor: optimize FlexSpringTransaction.java
This commit is contained in:
parent
f785ca2074
commit
73fdf8b815
@ -48,14 +48,15 @@ public class FlexSpringTransaction implements Transaction {
|
|||||||
autoCommit = connection.getAutoCommit();
|
autoCommit = connection.getAutoCommit();
|
||||||
return connection;
|
return connection;
|
||||||
}
|
}
|
||||||
// 非事务
|
// 在事务中,通过 FlexDataSource 去获取
|
||||||
else if (!isConnectionTransactional) {
|
// FlexDataSource 内部会进行 connection 缓存以及多数据源下的 key 判断
|
||||||
return connection;
|
else if (isConnectionTransactional) {
|
||||||
}
|
|
||||||
// 在事务中
|
|
||||||
else {
|
|
||||||
return dataSource.getConnection();
|
return dataSource.getConnection();
|
||||||
}
|
}
|
||||||
|
// 非事务,返回当前链接
|
||||||
|
else {
|
||||||
|
return connection;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user