mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-02 05:20:15 +08:00
update sql error
This commit is contained in:
@ -134,6 +134,8 @@ public class MysqlDBManage extends DefaultDBManage implements DBManage {
|
||||
} catch (Exception e) {
|
||||
connection.rollback();
|
||||
throw new RuntimeException(e);
|
||||
}finally {
|
||||
connection.setAutoCommit(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -100,13 +100,13 @@ public class DlTemplateServiceImpl implements DlTemplateService {
|
||||
List<String> sqlList = SqlUtils.parse(param.getSql(), dbType);
|
||||
Connection connection = Chat2DBContext.getConnection();
|
||||
try {
|
||||
connection.setAutoCommit(false);
|
||||
// connection.setAutoCommit(false);
|
||||
for (String originalSql : sqlList) {
|
||||
ExecuteResult executeResult = executor.executeUpdate(originalSql, connection, 1);
|
||||
dataResult.setData(executeResult);
|
||||
addOperationLog(executeResult);
|
||||
}
|
||||
connection.commit();
|
||||
// connection.commit();
|
||||
} catch (Exception e) {
|
||||
log.error("executeUpdate error", e);
|
||||
dataResult.setSuccess(false);
|
||||
|
Reference in New Issue
Block a user