mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
This commit is contained in:
parent
dcce259e08
commit
1db2e81f45
@ -69,14 +69,14 @@ public class FlexSpringTransaction implements Transaction {
|
||||
|
||||
@Override
|
||||
public void commit() throws SQLException {
|
||||
if (!isTransaction && !autoCommit) {
|
||||
if (isHoldConnection() && !isTransaction && !autoCommit) {
|
||||
getConnection().commit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rollback() throws SQLException {
|
||||
if (!isTransaction && !autoCommit) {
|
||||
if (isHoldConnection() && !isTransaction && !autoCommit) {
|
||||
getConnection().rollback();
|
||||
}
|
||||
}
|
||||
@ -90,4 +90,8 @@ public class FlexSpringTransaction implements Transaction {
|
||||
public Integer getTimeout() throws SQLException {
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isHoldConnection() {
|
||||
return !connectionMap.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user