diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java index e4817ddc18..3f53c535d2 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java @@ -22,7 +22,6 @@ import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; -import springfox.documentation.swagger2.annotations.EnableSwagger2; @SpringBootApplication @ServletComponentScan diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java index 001a10d08a..f3dcbfa237 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java @@ -177,7 +177,7 @@ public class AlertGroupService extends BaseService{ * @param id alert group id * @return delete result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map delAlertgroupById(User loginUser, int id) { Map result = new HashMap<>(5); result.put(Constants.STATUS, false); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java index caedf854e7..892d53bcbf 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java @@ -600,7 +600,7 @@ public class DataSourceService extends BaseService{ * @param datasourceId data source id * @return delete result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) 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/ProcessDefinitionService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java index e23ed0002a..b3d56e5982 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java @@ -438,7 +438,7 @@ public class ProcessDefinitionService extends BaseDAGService { * @param processDefinitionId process definition id * @return delete result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map deleteProcessDefinitionById(User loginUser, String projectName, Integer processDefinitionId) { Map result = new HashMap<>(5); @@ -504,7 +504,7 @@ public class ProcessDefinitionService extends BaseDAGService { * @param releaseState release state * @return release result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map releaseProcessDefinition(User loginUser, String projectName, int id, int releaseState) { HashMap result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); @@ -751,7 +751,7 @@ public class ProcessDefinitionService extends BaseDAGService { * @param currentProjectName current project name * @return import process */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map importProcessDefinition(User loginUser, MultipartFile file, String currentProjectName) { Map result = new HashMap<>(5); String processMetaJson = FileUtils.file2String(file); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java index e3d6311d46..a5d0a0241b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java @@ -466,7 +466,7 @@ public class ProcessInstanceService extends BaseDAGService { * @param processInstanceId process instance id * @return delete result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map deleteProcessInstanceById(User loginUser, String projectName, Integer processInstanceId) { Map result = new HashMap<>(5); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java index ded6594192..3cb715b964 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java @@ -86,7 +86,7 @@ public class ResourcesService extends BaseService { * @param currentDir current directory * @return create directory result */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Result createDirectory(User loginUser, String name, String description, @@ -160,7 +160,7 @@ public class ResourcesService extends BaseService { * @param currentDir current directory * @return create result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Result createResource(User loginUser, String name, String desc, @@ -288,7 +288,7 @@ public class ResourcesService extends BaseService { * @param type resource type * @return update result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Result updateResource(User loginUser, int resourceId, String name, @@ -827,7 +827,7 @@ public class ResourcesService extends BaseService { * @param content content * @return create result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Result onlineCreateResource(User loginUser, ResourceType type, String fileName, String fileSuffix, String desc, String content,int pid,String currentDirectory) { Result result = new Result(); // if resource upload startup @@ -889,7 +889,7 @@ public class ResourcesService extends BaseService { * @param content content * @return update result cod */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Result updateResourceContent(int resourceId, String content) { Result result = new Result(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java index ed856d5094..78a36c639a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java @@ -47,7 +47,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.io.IOException; import java.text.ParseException; import java.util.*; @@ -95,9 +94,8 @@ public class SchedulerService extends BaseService { * @param receiversCc receivers cc * @param workerGroup worker group * @return create result code - * @throws IOException ioexception */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map insertSchedule(User loginUser, String projectName, Integer processDefineId, String schedule, @@ -107,7 +105,7 @@ public class SchedulerService extends BaseService { String receivers, String receiversCc, Priority processInstancePriority, - String workerGroup) throws IOException { + String workerGroup) { Map result = new HashMap(5); @@ -192,9 +190,8 @@ public class SchedulerService extends BaseService { * @param receivers receivers * @param scheduleStatus schedule status * @return update result code - * @throws IOException ioexception */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map updateSchedule(User loginUser, String projectName, Integer id, @@ -206,7 +203,7 @@ public class SchedulerService extends BaseService { String receiversCc, ReleaseState scheduleStatus, Priority processInstancePriority, - String workerGroup) throws IOException { + String workerGroup) { Map result = new HashMap(5); Project project = projectMapper.queryByName(projectName); @@ -296,7 +293,7 @@ public class SchedulerService extends BaseService { * @param scheduleStatus schedule status * @return publish result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map setScheduleState(User loginUser, String projectName, Integer id, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java index 2588dd0e65..b4aab962ef 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SessionService.java @@ -81,7 +81,7 @@ public class SessionService extends BaseService{ * @param ip ip * @return session string */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public String createSession(User user, String ip) { Session session = null; diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UdfFuncService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UdfFuncService.java index 8a0bf748bb..bb92c9ccf7 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UdfFuncService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UdfFuncService.java @@ -300,7 +300,7 @@ public class UdfFuncService extends BaseService{ * @param id udf function id * @return delete result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Result delete(int id) { Result result = new Result(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java index bf51261e15..cbd795cce4 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java @@ -138,14 +138,14 @@ public class UsersService extends BaseService { } - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public User createUser(String userName, String userPassword, String email, int tenantId, String phone, String queue, - int state) throws Exception { + int state) { User user = new User(); Date now = new Date(); @@ -430,7 +430,7 @@ public class UsersService extends BaseService { * @param projectIds project id array * @return grant result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map grantProject(User loginUser, int userId, String projectIds) { Map result = new HashMap<>(5); result.put(Constants.STATUS, false); @@ -480,7 +480,7 @@ public class UsersService extends BaseService { * @param resourceIds resource id array * @return grant result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map grantResources(User loginUser, int userId, String resourceIds) { Map result = new HashMap<>(5); //only admin can operate @@ -577,7 +577,7 @@ public class UsersService extends BaseService { * @param udfIds udf id array * @return grant result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map grantUDFFunction(User loginUser, int userId, String udfIds) { Map result = new HashMap<>(5); @@ -624,7 +624,7 @@ public class UsersService extends BaseService { * @param datasourceIds data source id array * @return grant result code */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public Map grantDataSource(User loginUser, int userId, String datasourceIds) { Map result = new HashMap<>(5); result.put(Constants.STATUS, false); @@ -917,10 +917,9 @@ public class UsersService extends BaseService { * @param repeatPassword repeat password * @param email email * @return register result code - * @throws Exception exception */ - @Transactional(rollbackFor = Exception.class) - public Map registerUser(String userName, String userPassword, String repeatPassword, String email) throws Exception { + @Transactional(rollbackFor = RuntimeException.class) + public Map registerUser(String userName, String userPassword, String repeatPassword, String email) { Map result = new HashMap<>(5); //check user params 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 769fe0928a..cdb469c511 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 @@ -107,7 +107,7 @@ public class ProcessService { * @param command found command * @return process instance */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public ProcessInstance handleCommand(Logger logger, String host, int validThreadNum, Command command) { ProcessInstance processInstance = constructProcessInstance(command, host); //cannot construct process instance, return null; @@ -133,7 +133,7 @@ public class ProcessService { * @param command command * @param message message */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public void moveToErrorCommand(Command command, String message) { ErrorCommand errorCommand = new ErrorCommand(command, message); this.errorCommandMapper.insert(errorCommand); @@ -827,7 +827,7 @@ public class ProcessService { * @param taskInstance taskInstance * @return task instance */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public TaskInstance submitTask(TaskInstance taskInstance){ ProcessInstance processInstance = this.findProcessInstanceDetailById(taskInstance.getProcessInstanceId()); logger.info("start submit task : {}, instance id:{}, state: {}", @@ -1477,7 +1477,7 @@ public class ProcessService { * process need failover process instance * @param processInstance processInstance */ - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = RuntimeException.class) public void processNeedFailoverProcessInstances(ProcessInstance processInstance){ //1 update processInstance host is null processInstance.setHost(Constants.NULL);