Browse Source

[API] Do not specify rollback for ensure in case of any exception or error. (#10793)

3.1.0-release
WangJPLeo 2 years ago committed by GitHub
parent
commit
b7fbf6c4ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java
  2. 6
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java
  3. 6
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ClusterServiceImpl.java
  4. 6
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java
  5. 6
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java
  6. 24
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
  7. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
  8. 10
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessTaskRelationServiceImpl.java
  9. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java
  10. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java
  11. 12
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
  12. 6
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
  13. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java
  14. 12
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
  15. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java
  16. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java
  17. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java
  18. 20
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
  19. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
  20. 4
      dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
  21. 4
      dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java

@ -109,6 +109,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok
/** /**
* create token * create token
* *
* @param loginUser
* @param userId token for user * @param userId token for user
* @param expireTime token expire time * @param expireTime token expire time
* @param token token string (if it is absent, it will be automatically generated) * @param token token string (if it is absent, it will be automatically generated)
@ -161,6 +162,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok
/** /**
* generate token * generate token
* *
* @param loginUser
* @param userId token for user * @param userId token for user
* @param expireTime token expire time * @param expireTime token expire time
* @return token string * @return token string

6
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java

@ -160,7 +160,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup
* @return create result code * @return create result code
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> createAlertgroup(User loginUser, String groupName, String desc, String alertInstanceIds) { public Map<String, Object> createAlertgroup(User loginUser, String groupName, String desc, String alertInstanceIds) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
//only admin can operate //only admin can operate
@ -192,8 +192,6 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup
} catch (DuplicateKeyException ex) { } catch (DuplicateKeyException ex) {
logger.error("Create alert group error.", ex); logger.error("Create alert group error.", ex);
putMsg(result, Status.ALERT_GROUP_EXIST); putMsg(result, Status.ALERT_GROUP_EXIST);
} catch (RuntimeException e) {
throw new RuntimeException(e.getMessage());
} }
return result; return result;
@ -253,7 +251,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup
* @return delete result code * @return delete result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> delAlertgroupById(User loginUser, int id) { public Map<String, Object> delAlertgroupById(User loginUser, int id) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false); result.put(Constants.STATUS, false);

6
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ClusterServiceImpl.java

@ -68,7 +68,7 @@ public class ClusterServiceImpl extends BaseServiceImpl implements ClusterServic
* @param config cluster config * @param config cluster config
* @param desc cluster desc * @param desc cluster desc
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> createCluster(User loginUser, String name, String config, String desc) { public Map<String, Object> createCluster(User loginUser, String name, String config, String desc) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -229,7 +229,7 @@ public class ClusterServiceImpl extends BaseServiceImpl implements ClusterServic
* @param loginUser login user * @param loginUser login user
* @param code cluster code * @param code cluster code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> deleteClusterByCode(User loginUser, Long code) { public Map<String, Object> deleteClusterByCode(User loginUser, Long code) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -256,7 +256,7 @@ public class ClusterServiceImpl extends BaseServiceImpl implements ClusterServic
* @param config cluster config * @param config cluster config
* @param desc cluster desc * @param desc cluster desc
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> updateClusterByCode(User loginUser, Long code, String name, String config, String desc) { public Map<String, Object> updateClusterByCode(User loginUser, Long code, String name, String config, String desc) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();

6
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java

@ -100,7 +100,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource
* @return create result code * @return create result code
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Result<Object> createDataSource(User loginUser, BaseDataSourceParamDTO datasourceParam) { public Result<Object> createDataSource(User loginUser, BaseDataSourceParamDTO datasourceParam) {
DataSourceUtils.checkDatasourceParam(datasourceParam); DataSourceUtils.checkDatasourceParam(datasourceParam);
Result<Object> result = new Result<>(); Result<Object> result = new Result<>();
@ -140,8 +140,6 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource
} catch (DuplicateKeyException ex) { } catch (DuplicateKeyException ex) {
logger.error("Create datasource error.", ex); logger.error("Create datasource error.", ex);
putMsg(result, Status.DATASOURCE_EXIST); putMsg(result, Status.DATASOURCE_EXIST);
} catch (RuntimeException e) {
throw new RuntimeException(e.getMessage());
} }
return result; return result;
@ -396,7 +394,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource
* @return delete result code * @return delete result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Result<Object> delete(User loginUser, int datasourceId) { public Result<Object> delete(User loginUser, int datasourceId) {
Result<Object> result = new Result<>(); Result<Object> result = new Result<>();
try { try {

6
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java

@ -93,7 +93,7 @@ public class EnvironmentServiceImpl extends BaseServiceImpl implements Environme
* @param workerGroups worker groups * @param workerGroups worker groups
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> createEnvironment(User loginUser, String name, String config, String desc, String workerGroups) { public Map<String, Object> createEnvironment(User loginUser, String name, String config, String desc, String workerGroups) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if (!canOperatorPermissions(loginUser, null, AuthorizationType.ENVIRONMENT, ENVIRONMENT_CREATE)) { if (!canOperatorPermissions(loginUser, null, AuthorizationType.ENVIRONMENT, ENVIRONMENT_CREATE)) {
@ -303,7 +303,7 @@ public class EnvironmentServiceImpl extends BaseServiceImpl implements Environme
* @param loginUser login user * @param loginUser login user
* @param code environment code * @param code environment code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> deleteEnvironmentByCode(User loginUser, Long code) { public Map<String, Object> deleteEnvironmentByCode(User loginUser, Long code) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -342,7 +342,7 @@ public class EnvironmentServiceImpl extends BaseServiceImpl implements Environme
* @param desc environment desc * @param desc environment desc
* @param workerGroups worker groups * @param workerGroups worker groups
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> updateEnvironmentByCode(User loginUser, Long code, String name, String config, String desc, String workerGroups) { public Map<String, Object> updateEnvironmentByCode(User loginUser, Long code, String name, String config, String desc, String workerGroups) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();

24
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java

@ -220,7 +220,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return create result code * @return create result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> createProcessDefinition(User loginUser, public Map<String, Object> createProcessDefinition(User loginUser,
long projectCode, long projectCode,
String name, String name,
@ -547,7 +547,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return update result code * @return update result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> updateProcessDefinition(User loginUser, public Map<String, Object> updateProcessDefinition(User loginUser,
long projectCode, long projectCode,
String name, String name,
@ -707,7 +707,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return delete result code * @return delete result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> deleteProcessDefinitionByCode(User loginUser, long projectCode, long code) { public Map<String, Object> deleteProcessDefinitionByCode(User loginUser, long projectCode, long code) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
//check user access for project //check user access for project
@ -778,7 +778,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return release result code * @return release result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> releaseProcessDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) { public Map<String, Object> releaseProcessDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
//check user access for project //check user access for project
@ -918,7 +918,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return import process * @return import process
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> importProcessDefinition(User loginUser, long projectCode, MultipartFile file) { public Map<String, Object> importProcessDefinition(User loginUser, long projectCode, MultipartFile file) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
String dagDataScheduleJson = FileUtils.file2String(file); String dagDataScheduleJson = FileUtils.file2String(file);
@ -942,7 +942,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
} }
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> importSqlProcessDefinition(User loginUser, long projectCode, MultipartFile file) { public Map<String, Object> importSqlProcessDefinition(User loginUser, long projectCode, MultipartFile file) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
@ -1687,7 +1687,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @param targetProjectCode targetProjectCode * @param targetProjectCode targetProjectCode
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> batchMoveProcessDefinition(User loginUser, public Map<String, Object> batchMoveProcessDefinition(User loginUser,
long projectCode, long projectCode,
String codes, String codes,
@ -1831,7 +1831,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return switch process definition version result code * @return switch process definition version result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> switchProcessDefinitionVersion(User loginUser, long projectCode, long code, int version) { public Map<String, Object> switchProcessDefinitionVersion(User loginUser, long projectCode, long code, int version) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
//check user access for project //check user access for project
@ -1926,7 +1926,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return delete result code * @return delete result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> deleteProcessDefinitionVersion(User loginUser, long projectCode, long code, int version) { public Map<String, Object> deleteProcessDefinitionVersion(User loginUser, long projectCode, long code, int version) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
//check user access for project //check user access for project
@ -1969,7 +1969,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return process definition code * @return process definition code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> createEmptyProcessDefinition(User loginUser, public Map<String, Object> createEmptyProcessDefinition(User loginUser,
long projectCode, long projectCode,
String name, String name,
@ -2096,7 +2096,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @return update result code * @return update result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> updateProcessDefinitionBasicInfo(User loginUser, public Map<String, Object> updateProcessDefinitionBasicInfo(User loginUser,
long projectCode, long projectCode,
String name, String name,
@ -2212,7 +2212,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
* @param releaseState releaseState * @param releaseState releaseState
* @return update result code * @return update result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> releaseWorkflowAndSchedule(User loginUser, long projectCode, long code, ReleaseState releaseState) { public Map<String, Object> releaseWorkflowAndSchedule(User loginUser, long projectCode, long code, ReleaseState releaseState) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java

@ -452,7 +452,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce
* @param tenantCode tenantCode * @param tenantCode tenantCode
* @return update result code * @return update result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> updateProcessInstance(User loginUser, long projectCode, Integer processInstanceId, String taskRelationJson, public Map<String, Object> updateProcessInstance(User loginUser, long projectCode, Integer processInstanceId, String taskRelationJson,
String taskDefinitionJson, String scheduleTime, Boolean syncDefine, String globalParams, String taskDefinitionJson, String scheduleTime, Boolean syncDefine, String globalParams,
@ -619,7 +619,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce
* @return delete result code * @return delete result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> deleteProcessInstanceById(User loginUser, long projectCode, Integer processInstanceId) { public Map<String, Object> deleteProcessInstanceById(User loginUser, long projectCode, Integer processInstanceId) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
//check user access for project //check user access for project

10
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 * @param postTaskCode postTaskCode
* @return create result code * @return create result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> createProcessTaskRelation(User loginUser, long projectCode, long processDefinitionCode, long preTaskCode, long postTaskCode) { public Map<String, Object> createProcessTaskRelation(User loginUser, long projectCode, long processDefinitionCode, long preTaskCode, long postTaskCode) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
@ -187,7 +187,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
* @param taskCode the post task code * @param taskCode the post task code
* @return delete result code * @return delete result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> deleteTaskProcessRelation(User loginUser, long projectCode, long processDefinitionCode, long taskCode) { public Map<String, Object> deleteTaskProcessRelation(User loginUser, long projectCode, long processDefinitionCode, long taskCode) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
@ -267,7 +267,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
* @param taskCode the post task code * @param taskCode the post task code
* @return delete result code * @return delete result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> deleteUpstreamRelation(User loginUser, long projectCode, String preTaskCodes, long taskCode) { public Map<String, Object> deleteUpstreamRelation(User loginUser, long projectCode, String preTaskCodes, long taskCode) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
@ -339,7 +339,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
* @param taskCode the pre task code * @param taskCode the pre task code
* @return delete result code * @return delete result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> deleteDownstreamRelation(User loginUser, long projectCode, String postTaskCodes, long taskCode) { public Map<String, Object> deleteDownstreamRelation(User loginUser, long projectCode, String postTaskCodes, long taskCode) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
@ -457,7 +457,7 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
* @param postTaskCode post task code * @param postTaskCode post task code
* @return delete result code * @return delete result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> deleteEdge(User loginUser, long projectCode, long processDefinitionCode, long preTaskCode, long postTaskCode) { public Map<String, Object> deleteEdge(User loginUser, long projectCode, long processDefinitionCode, long preTaskCode, long postTaskCode) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java

@ -87,7 +87,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic
* @return returns an error if it exists * @return returns an error if it exists
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> createProject(User loginUser, String name, String desc) { public Map<String, Object> createProject(User loginUser, String name, String desc) {
Map<String, Object> result = checkDesc(desc); Map<String, Object> result = checkDesc(desc);

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java

@ -123,7 +123,7 @@ public class QueueServiceImpl extends BaseServiceImpl implements QueueService {
* @return create result * @return create result
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> createQueue(User loginUser, String queue, String queueName) { public Map<String, Object> createQueue(User loginUser, String queue, String queueName) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if (!canOperatorPermissions(loginUser,null, AuthorizationType.QUEUE,YARN_QUEUE_CREATE)) { if (!canOperatorPermissions(loginUser,null, AuthorizationType.QUEUE,YARN_QUEUE_CREATE)) {

12
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java

@ -134,7 +134,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
* @return create directory result * @return create directory result
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Result<Object> createDirectory(User loginUser, public Result<Object> createDirectory(User loginUser,
String name, String name,
String description, String description,
@ -214,7 +214,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
* @return create result code * @return create result code
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Result<Object> createResource(User loginUser, public Result<Object> createResource(User loginUser,
String name, String name,
String desc, String desc,
@ -343,7 +343,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
* @return update result code * @return update result code
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Result<Object> updateResource(User loginUser, public Result<Object> updateResource(User loginUser,
int resourceId, int resourceId,
String name, String name,
@ -777,7 +777,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
* @throws IOException exception * @throws IOException exception
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Result<Object> delete(User loginUser, int resourceId) throws IOException { public Result<Object> delete(User loginUser, int resourceId) throws IOException {
// get resource by id // get resource by id
Result<Object> resultCheck = new Result<>(); Result<Object> resultCheck = new Result<>();
@ -1054,7 +1054,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
* @return create result code * @return create result code
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Result<Object> onlineCreateResource(User loginUser, ResourceType type, String fileName, String fileSuffix, String desc, String content, int pid, String currentDir) { public Result<Object> onlineCreateResource(User loginUser, ResourceType type, String fileName, String fileSuffix, String desc, String content, int pid, String currentDir) {
Result<Object> result = new Result<>(); Result<Object> result = new Result<>();
boolean canOperatorPermissions = canOperatorPermissions(loginUser, null, AuthorizationType.RESOURCE_FILE_ID, ApiFuncIdentificationConstant.FILE_ONLINE_CREATE); boolean canOperatorPermissions = canOperatorPermissions(loginUser, null, AuthorizationType.RESOURCE_FILE_ID, ApiFuncIdentificationConstant.FILE_ONLINE_CREATE);
@ -1167,7 +1167,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
* @return update result cod * @return update result cod
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Result<Object> updateResourceContent(User loginUser, int resourceId, String content) { public Result<Object> updateResourceContent(User loginUser, int resourceId, String content) {
Result<Object> result = checkResourceUploadStartupState(); Result<Object> result = checkResourceUploadStartupState();
if (!result.getCode().equals(Status.SUCCESS.getCode())) { if (!result.getCode().equals(Status.SUCCESS.getCode())) {

6
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java

@ -121,7 +121,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
* @return create result code * @return create result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> insertSchedule(User loginUser, public Map<String, Object> insertSchedule(User loginUser,
long projectCode, long projectCode,
long processDefineCode, long processDefineCode,
@ -222,7 +222,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
* @return update result code * @return update result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> updateSchedule(User loginUser, public Map<String, Object> updateSchedule(User loginUser,
long projectCode, long projectCode,
Integer id, Integer id,
@ -272,7 +272,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
* @return publish result code * @return publish result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> setScheduleState(User loginUser, public Map<String, Object> setScheduleState(User loginUser,
long projectCode, long projectCode,
Integer id, Integer id,

2
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 * @return session string
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public String createSession(User user, String ip) { public String createSession(User user, String ip) {
Session session = null; Session session = null;

12
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java

@ -115,7 +115,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
* @param projectCode project code * @param projectCode project code
* @param taskDefinitionJson task definition json * @param taskDefinitionJson task definition json
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> createTaskDefinition(User loginUser, public Map<String, Object> createTaskDefinition(User loginUser,
long projectCode, long projectCode,
@ -167,7 +167,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
* @param upstreamCodes upstream task codes, sep comma * @param upstreamCodes upstream task codes, sep comma
* @return create result code * @return create result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> createTaskBindsWorkFlow(User loginUser, public Map<String, Object> createTaskBindsWorkFlow(User loginUser,
long projectCode, long projectCode,
@ -302,7 +302,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
* @param projectCode project code * @param projectCode project code
* @param taskCode task code * @param taskCode task code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> deleteTaskDefinitionByCode(User loginUser, long projectCode, long taskCode) { public Map<String, Object> deleteTaskDefinitionByCode(User loginUser, long projectCode, long taskCode) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
@ -381,7 +381,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
* @param taskCode task code * @param taskCode task code
* @param taskDefinitionJsonObj task definition json object * @param taskDefinitionJsonObj task definition json object
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> updateTaskDefinition(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj) { public Map<String, Object> updateTaskDefinition(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -545,7 +545,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
* @param taskCode task code * @param taskCode task code
* @param version the version user want to switch * @param version the version user want to switch
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> switchVersion(User loginUser, long projectCode, long taskCode, int version) { public Map<String, Object> switchVersion(User loginUser, long projectCode, long taskCode, int version) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);
@ -739,7 +739,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
* @param releaseState releaseState * @param releaseState releaseState
* @return update result code * @return update result code
*/ */
@Transactional(rollbackFor = RuntimeException.class) @Transactional
@Override @Override
public Map<String, Object> releaseTaskDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) { public Map<String, Object> releaseTaskDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) {
Project project = projectMapper.queryByCode(projectCode); Project project = projectMapper.queryByCode(projectCode);

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java

@ -79,7 +79,7 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe
* @return the result code and msg * @return the result code and msg
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) { public Map<String, Object> createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java

@ -91,7 +91,7 @@ public class TenantServiceImpl extends BaseServiceImpl implements TenantService
* @throws Exception exception * @throws Exception exception
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> createTenant(User loginUser, public Map<String, Object> createTenant(User loginUser,
String tenantCode, String tenantCode,
int queueId, int queueId,
@ -242,7 +242,7 @@ public class TenantServiceImpl extends BaseServiceImpl implements TenantService
* @throws Exception exception * @throws Exception exception
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> deleteTenantById(User loginUser, int id) throws Exception { public Map<String, Object> deleteTenantById(User loginUser, int id) throws Exception {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java

@ -77,7 +77,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic
* @return create result code * @return create result code
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Result<Object> createUdfFunction(User loginUser, public Result<Object> createUdfFunction(User loginUser,
String funcName, String funcName,
String className, String className,
@ -336,7 +336,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic
* @return delete result code * @return delete result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Result<Object> delete(User loginUser, int id) { public Result<Object> delete(User loginUser, int id) {
Result<Object> result = new Result<>(); Result<Object> result = new Result<>();

20
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java

@ -146,7 +146,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* @throws Exception exception * @throws Exception exception
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> createUser(User loginUser, public Map<String, Object> createUser(User loginUser,
String userName, String userName,
String userPassword, String userPassword,
@ -195,7 +195,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
} }
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public User createUser(String userName, public User createUser(String userName,
String userPassword, String userPassword,
String email, String email,
@ -230,7 +230,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* create User for ldap login * create User for ldap login
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public User createUser(UserType userType, String userId, String email) { public User createUser(UserType userType, String userId, String email) {
User user = new User(); User user = new User();
Date now = new Date(); Date now = new Date();
@ -525,7 +525,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* @throws Exception exception when operate hdfs * @throws Exception exception when operate hdfs
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> deleteUserById(User loginUser, int id) throws IOException { public Map<String, Object> deleteUserById(User loginUser, int id) throws IOException {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if(resourcePermissionCheckService.functionDisabled()){ if(resourcePermissionCheckService.functionDisabled()){
@ -572,7 +572,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* @return grant result code * @return grant result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> grantProject(User loginUser, int userId, String projectIds) { public Map<String, Object> grantProject(User loginUser, int userId, String projectIds) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false); result.put(Constants.STATUS, false);
@ -714,7 +714,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* @return grant result code * @return grant result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> grantResources(User loginUser, int userId, String resourceIds) { public Map<String, Object> grantResources(User loginUser, int userId, String resourceIds) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -812,7 +812,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* @return grant result code * @return grant result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> grantUDFFunction(User loginUser, int userId, String udfIds) { public Map<String, Object> grantUDFFunction(User loginUser, int userId, String udfIds) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -860,7 +860,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* @return grant result code * @return grant result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> grantNamespaces(User loginUser, int userId, String namespaceIds) { public Map<String, Object> grantNamespaces(User loginUser, int userId, String namespaceIds) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false); result.put(Constants.STATUS, false);
@ -910,7 +910,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* @return grant result code * @return grant result code
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> grantDataSource(User loginUser, int userId, String datasourceIds) { public Map<String, Object> grantDataSource(User loginUser, int userId, String datasourceIds) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false); result.put(Constants.STATUS, false);
@ -1219,7 +1219,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
* @throws Exception exception * @throws Exception exception
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public Map<String, Object> registerUser(String userName, String userPassword, String repeatPassword, String email) { public Map<String, Object> registerUser(String userName, String userPassword, String repeatPassword, String email) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java

@ -84,7 +84,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro
* @return create or update result code * @return create or update result code
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> saveWorkerGroup(User loginUser, int id, String name, String addrList) { public Map<String, Object> saveWorkerGroup(User loginUser, int id, String name, String addrList) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if (!canOperatorPermissions(loginUser,null, AuthorizationType.WORKER_GROUP, WORKER_GROUP_CREATE)) { if (!canOperatorPermissions(loginUser,null, AuthorizationType.WORKER_GROUP, WORKER_GROUP_CREATE)) {
@ -326,7 +326,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro
* @return delete result code * @return delete result code
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public Map<String, Object> deleteWorkerGroupById(User loginUser, Integer id) { public Map<String, Object> deleteWorkerGroupById(User loginUser, Integer id) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if (!canOperatorPermissions(loginUser,null, AuthorizationType.WORKER_GROUP,WORKER_GROUP_DELETE)) { if (!canOperatorPermissions(loginUser,null, AuthorizationType.WORKER_GROUP,WORKER_GROUP_DELETE)) {

4
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

@ -105,7 +105,7 @@ public interface ProcessService {
TaskInstance submitTaskWithRetry(ProcessInstance processInstance, TaskInstance taskInstance, int commitRetryTimes, long commitInterval); TaskInstance submitTaskWithRetry(ProcessInstance processInstance, TaskInstance taskInstance, int commitRetryTimes, long commitInterval);
@Transactional(rollbackFor = Exception.class) @Transactional
TaskInstance submitTask(ProcessInstance processInstance, TaskInstance taskInstance); TaskInstance submitTask(ProcessInstance processInstance, TaskInstance taskInstance);
void createSubWorkProcess(ProcessInstance parentProcessInstance, TaskInstance task); void createSubWorkProcess(ProcessInstance parentProcessInstance, TaskInstance task);
@ -173,7 +173,7 @@ public interface ProcessService {
List<String> queryNeedFailoverProcessInstanceHost(); List<String> queryNeedFailoverProcessInstanceHost();
@Transactional(rollbackFor = RuntimeException.class) @Transactional
void processNeedFailoverProcessInstances(ProcessInstance processInstance); void processNeedFailoverProcessInstances(ProcessInstance processInstance);
List<TaskInstance> queryNeedFailoverTaskInstances(String host); List<TaskInstance> queryNeedFailoverTaskInstances(String host);

4
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessServiceImpl.java

@ -1296,7 +1296,7 @@ public class ProcessServiceImpl implements ProcessService {
* @return task instance * @return task instance
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional
public TaskInstance submitTask(ProcessInstance processInstance, TaskInstance taskInstance) { public TaskInstance submitTask(ProcessInstance processInstance, TaskInstance taskInstance) {
logger.info("start submit task : {}, processInstance id:{}, state: {}", logger.info("start submit task : {}, processInstance id:{}, state: {}",
taskInstance.getName(), taskInstance.getProcessInstanceId(), processInstance.getState()); taskInstance.getName(), taskInstance.getProcessInstanceId(), processInstance.getState());
@ -2059,7 +2059,7 @@ public class ProcessServiceImpl implements ProcessService {
* @param processInstance processInstance * @param processInstance processInstance
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional
public void processNeedFailoverProcessInstances(ProcessInstance processInstance) { public void processNeedFailoverProcessInstances(ProcessInstance processInstance) {
//1 update processInstance host is null //1 update processInstance host is null
processInstance.setHost(Constants.NULL); processInstance.setHost(Constants.NULL);

Loading…
Cancel
Save