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