diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java index d350d2888b..a987f99383 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java @@ -113,6 +113,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok /** * create token * + * @param loginUser * @param userId token for user * @param expireTime token expire time * @param token token string (if it is absent, it will be automatically generated) @@ -162,6 +163,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok /** * generate token * + * @param loginUser * @param userId token for user * @param expireTime token expire time * @return token string diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java index afd0846d11..32549afe3c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java @@ -137,6 +137,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup * @return create result code */ @Override + @Transactional public Map createAlertgroup(User loginUser, String groupName, String desc, String alertInstanceIds) { Map result = new HashMap<>(); //only admin can operate @@ -224,7 +225,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup * @return delete result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map delAlertgroupById(User loginUser, int id) { Map result = new HashMap<>(); result.put(Constants.STATUS, false); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java index 0ad634210a..8090ded700 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java @@ -91,6 +91,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @return create result code */ @Override + @Transactional public Result createDataSource(User loginUser, BaseDataSourceParamDTO datasourceParam) { DataSourceUtils.checkDatasourceParam(datasourceParam); Result result = new Result<>(); @@ -371,7 +372,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @return delete result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Result delete(User loginUser, int datasourceId) { Result result = new Result<>(); try { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java index 9734869633..f5994e880f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java @@ -87,8 +87,8 @@ public class EnvironmentServiceImpl extends BaseServiceImpl implements Environme * @param desc environment desc * @param workerGroups worker groups */ - @Transactional(rollbackFor = RuntimeException.class) @Override + @Transactional public Map createEnvironment(User loginUser, String name, String config, String desc, String workerGroups) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { @@ -280,7 +280,7 @@ public class EnvironmentServiceImpl extends BaseServiceImpl implements Environme * @param loginUser login user * @param code environment code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map deleteEnvironmentByCode(User loginUser, Long code) { Map result = new HashMap<>(); @@ -318,7 +318,7 @@ public class EnvironmentServiceImpl extends BaseServiceImpl implements Environme * @param desc environment desc * @param workerGroups worker groups */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map updateEnvironmentByCode(User loginUser, Long code, String name, String config, String desc, String workerGroups) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java index e95a62aadc..2492b21212 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java @@ -208,7 +208,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return create result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map createProcessDefinition(User loginUser, long projectCode, String name, @@ -532,7 +532,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return update result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map updateProcessDefinition(User loginUser, long projectCode, String name, @@ -689,7 +689,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return delete result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map deleteProcessDefinitionByCode(User loginUser, long projectCode, long code) { Project project = projectMapper.queryByCode(projectCode); //check user access for project @@ -760,7 +760,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return release result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map releaseProcessDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) { Project project = projectMapper.queryByCode(projectCode); //check user access for project @@ -900,7 +900,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return import process */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map importProcessDefinition(User loginUser, long projectCode, MultipartFile file) { Map result = new HashMap<>(); String dagDataScheduleJson = FileUtils.file2String(file); @@ -919,7 +919,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro } @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map importSqlProcessDefinition(User loginUser, long projectCode, MultipartFile file) { Map result = new HashMap<>(); String processDefinitionName = file.getOriginalFilename() == null ? file.getName() : file.getOriginalFilename(); @@ -1653,7 +1653,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @param targetProjectCode targetProjectCode */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map batchMoveProcessDefinition(User loginUser, long projectCode, String codes, @@ -1795,7 +1795,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return switch process definition version result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map switchProcessDefinitionVersion(User loginUser, long projectCode, long code, int version) { Project project = projectMapper.queryByCode(projectCode); //check user access for project @@ -1890,7 +1890,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return delete result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map deleteProcessDefinitionVersion(User loginUser, long projectCode, long code, int version) { Project project = projectMapper.queryByCode(projectCode); //check user access for project @@ -1932,7 +1932,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return process definition code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map createEmptyProcessDefinition(User loginUser, long projectCode, String name, @@ -2058,7 +2058,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @return update result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map updateProcessDefinitionBasicInfo(User loginUser, long projectCode, String name, @@ -2173,7 +2173,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro * @param releaseState releaseState * @return update result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map releaseWorkflowAndSchedule(User loginUser, long projectCode, long code, ReleaseState releaseState) { Project project = projectMapper.queryByCode(projectCode); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java index 4c84ec2666..519c449cdb 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java @@ -448,7 +448,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param tenantCode tenantCode * @return update result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map updateProcessInstance(User loginUser, long projectCode, Integer processInstanceId, String taskRelationJson, String taskDefinitionJson, String scheduleTime, Boolean syncDefine, String globalParams, @@ -615,7 +615,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @return delete result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map deleteProcessInstanceById(User loginUser, long projectCode, Integer processInstanceId) { Project project = projectMapper.queryByCode(projectCode); //check user access for project diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java index 26a1e88a05..1230a3978a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java @@ -96,7 +96,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P * @param postTaskCode postTaskCode * @return create result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map createProcessTaskRelation(User loginUser, long projectCode, long processDefinitionCode, long preTaskCode, long postTaskCode) { Project project = projectMapper.queryByCode(projectCode); @@ -187,7 +187,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P * @param taskCode the post task code * @return delete result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map deleteTaskProcessRelation(User loginUser, long projectCode, long processDefinitionCode, long taskCode) { Project project = projectMapper.queryByCode(projectCode); @@ -267,7 +267,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P * @param taskCode the post task code * @return delete result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map deleteUpstreamRelation(User loginUser, long projectCode, String preTaskCodes, long taskCode) { Project project = projectMapper.queryByCode(projectCode); @@ -339,7 +339,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P * @param taskCode the pre task code * @return delete result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map deleteDownstreamRelation(User loginUser, long projectCode, String postTaskCodes, long taskCode) { Project project = projectMapper.queryByCode(projectCode); @@ -457,7 +457,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P * @param postTaskCode post task code * @return delete result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map deleteEdge(User loginUser, long projectCode, long processDefinitionCode, long preTaskCode, long postTaskCode) { Project project = projectMapper.queryByCode(projectCode); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java index e10a83f8e1..15806ad22f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java @@ -37,6 +37,7 @@ import org.apache.dolphinscheduler.dao.mapper.ProjectUserMapper; import org.apache.dolphinscheduler.dao.mapper.UserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; @@ -75,6 +76,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @return returns an error if it exists */ @Override + @Transactional public Map createProject(User loginUser, String name, String desc) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java index 435f3875e2..30c3401c01 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java @@ -39,6 +39,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -159,6 +160,7 @@ public class QueueServiceImpl extends BaseServiceImpl implements QueueService { * @return create result */ @Override + @Transactional public Map createQueue(User loginUser, String queue, String queueName) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java index 312bb014d4..5cdac59d37 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java @@ -1188,7 +1188,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @return update result cod */ @Override - @Transactional(rollbackFor = Exception.class) + @Transactional public Result updateResourceContent(int resourceId, String content) { Result result = checkResourceUploadStartupState(); if (!result.getCode().equals(Status.SUCCESS.getCode())) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java index c222c4ce2b..62ada1c45b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java @@ -126,7 +126,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @return create result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map insertSchedule(User loginUser, long projectCode, long processDefineCode, @@ -227,7 +227,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @return update result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map updateSchedule(User loginUser, long projectCode, Integer id, @@ -277,7 +277,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @return publish result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map setScheduleState(User loginUser, long projectCode, Integer id, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java index 2cee43f585..19bb43681b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java @@ -88,7 +88,7 @@ public class SessionServiceImpl extends BaseServiceImpl implements SessionServic * @return session string */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public String createSession(User user, String ip) { Session session = null; diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java index 15105acfe8..f35dc2451a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java @@ -113,7 +113,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe * @param projectCode project code * @param taskDefinitionJson task definition json */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map createTaskDefinition(User loginUser, long projectCode, @@ -165,7 +165,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe * @param upstreamCodes upstream task codes, sep comma * @return create result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map createTaskBindsWorkFlow(User loginUser, long projectCode, @@ -300,7 +300,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe * @param projectCode project code * @param taskCode task code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map deleteTaskDefinitionByCode(User loginUser, long projectCode, long taskCode) { Project project = projectMapper.queryByCode(projectCode); @@ -379,7 +379,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe * @param taskCode task code * @param taskDefinitionJsonObj task definition json object */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map updateTaskDefinition(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj) { Map result = new HashMap<>(); @@ -543,7 +543,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe * @param taskCode task code * @param version the version user want to switch */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map switchVersion(User loginUser, long projectCode, long taskCode, int version) { Project project = projectMapper.queryByCode(projectCode); @@ -737,7 +737,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe * @param releaseState releaseState * @return update result code */ - @Transactional(rollbackFor = RuntimeException.class) + @Transactional @Override public Map releaseTaskDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) { Project project = projectMapper.queryByCode(projectCode); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java index 6655455427..6f503565c7 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java @@ -40,6 +40,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -75,6 +76,7 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe * @return the result code and msg */ @Override + @Transactional public Map createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) { Map result = new HashMap<>(); if (name == null) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java index f156eadeb2..9766be31ba 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java @@ -78,6 +78,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @return create result code */ @Override + @Transactional public Result createUdfFunction(User loginUser, String funcName, String className, @@ -304,7 +305,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @return delete result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Result delete(int id) { Result result = new Result<>(); udfFuncMapper.deleteById(id); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java index deb57d6f4b..4ae08f91ab 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java @@ -137,7 +137,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @throws Exception exception */ @Override - @Transactional(rollbackFor = Exception.class) + @Transactional public Map createUser(User loginUser, String userName, String userPassword, @@ -181,7 +181,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { } @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public User createUser(String userName, String userPassword, String email, @@ -216,7 +216,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * create User for ldap login */ @Override - @Transactional(rollbackFor = Exception.class) + @Transactional public User createUser(UserType userType, String userId, String email) { User user = new User(); Date now = new Date(); @@ -503,7 +503,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @throws Exception exception when operate hdfs */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map deleteUserById(User loginUser, int id) throws IOException { Map result = new HashMap<>(); //only admin can operate @@ -546,7 +546,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return grant result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map grantProject(User loginUser, int userId, String projectIds) { Map result = new HashMap<>(); result.put(Constants.STATUS, false); @@ -675,7 +675,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return grant result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map grantResources(User loginUser, int userId, String resourceIds) { Map result = new HashMap<>(); @@ -769,7 +769,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return grant result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map grantUDFFunction(User loginUser, int userId, String udfIds) { Map result = new HashMap<>(); @@ -813,7 +813,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return grant result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map grantNamespaces(User loginUser, int userId, String namespaceIds) { Map result = new HashMap<>(); result.put(Constants.STATUS, false); @@ -860,7 +860,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return grant result code */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map grantDataSource(User loginUser, int userId, String datasourceIds) { Map result = new HashMap<>(); result.put(Constants.STATUS, false); @@ -1143,7 +1143,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @throws Exception exception */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public Map registerUser(String userName, String userPassword, String repeatPassword, String email) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java index d7df710e34..7b2ba68a2b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java @@ -78,6 +78,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro * @return create or update result code */ @Override + @Transactional public Map saveWorkerGroup(User loginUser, int id, String name, String addrList) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { @@ -304,7 +305,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro * @return delete result code */ @Override - @Transactional(rollbackFor = Exception.class) + @Transactional public Map deleteWorkerGroupById(User loginUser, Integer id) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java index 86f6eb0160..47e4732a4f 100644 --- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java +++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java @@ -106,7 +106,7 @@ public interface ProcessService { TaskInstance submitTaskWithRetry(ProcessInstance processInstance, TaskInstance taskInstance, int commitRetryTimes, long commitInterval); - @Transactional(rollbackFor = Exception.class) + @Transactional TaskInstance submitTask(ProcessInstance processInstance, TaskInstance taskInstance); void createSubWorkProcess(ProcessInstance parentProcessInstance, TaskInstance task); @@ -174,7 +174,7 @@ public interface ProcessService { List queryNeedFailoverProcessInstanceHost(); - @Transactional(rollbackFor = RuntimeException.class) + @Transactional void processNeedFailoverProcessInstances(ProcessInstance processInstance); List queryNeedFailoverTaskInstances(String host); diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java index 3dfca6e764..2e1f63fbcb 100644 --- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java +++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java @@ -1270,7 +1270,7 @@ public class ProcessServiceImpl implements ProcessService { * @return task instance */ @Override - @Transactional(rollbackFor = Exception.class) + @Transactional public TaskInstance submitTask(ProcessInstance processInstance, TaskInstance taskInstance) { logger.info("Start save taskInstance to database : {}, processInstance id:{}, state: {}", taskInstance.getName(), @@ -2044,7 +2044,7 @@ public class ProcessServiceImpl implements ProcessService { * @param processInstance processInstance */ @Override - @Transactional(rollbackFor = RuntimeException.class) + @Transactional public void processNeedFailoverProcessInstances(ProcessInstance processInstance) { //1 update processInstance host is null processInstance.setHost(Constants.NULL);