chenjh3 2023-08-21 16:45:17 +08:00
parent dcce259e08
commit 1db2e81f45

View File

@ -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();
}
}