HomminLee commented on a change in pull request #6981:
URL: https://github.com/apache/dolphinscheduler/pull/6981#discussion_r761818384
##########
File path:
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
##########
@@ -2225,6 +2236,7 @@ public String getResourceIds(TaskDefinition
taskDefinition) {
return StringUtils.join(resourceIds, ",");
}
+ @Transactional
Review comment:
I had create a demo project to verify nested transactions, variables
have: normal, error, try-catch in outer method; normal, error in inner method;
REQUIRED propagation(defaut), REQUIRES_NEW propagation.
If use REQUIRED propagation, inner method and outer method will use the same
transaction. Any exception occurs, both will rollback. It needs to be explained
that the transaction will rollback even if outer method catch the exception
thrown by the innter method, cause when the transaction try to commit, it will
get the exception: "Transaction rolled back because it has been marked as
rollback-only".
If use REQUIRES_NEW propagation, inner method and outer method will use the
different transaction. Two transactions will not affect each other. If the
outer layer has a try catch of inner method and resolve the exception, the
outer method still can commit outer transaction.
I think the default propagation(REQUIRED) is more suitable, what do you
think?@caishunfeng @ruanwenjun
@JinyLeeChina
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]