Unverified Commit d006bd3b authored by Yichao Yang's avatar Yichao Yang Committed by GitHub
Browse files

[Improvement][api] Refactor the transaction rollbackfor runtimeexception (#3313)

* [Improvement][api] Refactor the transaction rollbackfor runtimeexception

* Remove the unused import
parent d79af508
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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<String, Object> delAlertgroupById(User loginUser, int id) {
        Map<String, Object> result = new HashMap<>(5);
        result.put(Constants.STATUS, false);
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+3 −3
Original line number Diff line number Diff line
@@ -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<String, Object> deleteProcessDefinitionById(User loginUser, String projectName, Integer processDefinitionId) {

        Map<String, Object> 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<String, Object> releaseProcessDefinition(User loginUser, String projectName, int id, int releaseState) {
        HashMap<String, Object> 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<String, Object> importProcessDefinition(User loginUser, MultipartFile file, String currentProjectName) {
        Map<String, Object> result = new HashMap<>(5);
        String processMetaJson = FileUtils.file2String(file);
+1 −1
Original line number Diff line number Diff line
@@ -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<String, Object> deleteProcessInstanceById(User loginUser, String projectName, Integer processInstanceId) {

        Map<String, Object> result = new HashMap<>(5);
Loading